Part Number Hot Search : 
LVC1G0 C7534 11EWA TF155A XFGIB 01D105 P202K HD1107R
Product Description
Full Text Search
 

To Download Z8L18008FEC Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  zilog w o r l d w i d e h e a d q u a r t e r s ? 910 e. h a m i l t o n a v e n u e ? c a m p b e l l , ca 95008 t e l e p h o n e : 408.558.8500 ? f a x : 408.558.8300 ? w w w .z i log. c o m z8018x family mpu user manual um005001-zmp0400
z8018x family mpu user manual um005001-zmp0400 this publication is subject to replacement by a later edition. to determine whether a later edition exists, or to request copies of publications, contact zilog worldwide headquarters 910 e. hamilton avenue campbell, ca 95008 telephone: 408.558.8500 fax: 408.558.8300 www.zilog.com windows is a registered trademark of microsoft corporation. document disclaimer ? 2000 by zilog, inc. all rights reserved. information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. zilog, inc. does not assume liability for or provide a representation of accuracy of the information, devices, or technology described in this document. zilog also does not assume liability for intellectual property infringement related in any manner to use of information, devices, or technology described herein or otherwise. except with the express written approval zilog, use of information, devices, or technology as critical components of life support systems is not authorized. no licenses or other rights are conveyed, implicitly or otherwise, by this document under any intellectual property rights.
z8018x family mpu user manual um005001-zmp0400 iii manual objectives this user manual describes the features of the z8018x family mpus.this manual provides basic programming information for the z80180/z8s180/ z8l180. these cores and base perippheral sets are used in a large family of zilog products. below is a list of zilog products that use this class of processor, along with the associated processor family.this document is also the core user manual for the following products: intended audience this manual is written for those who program the z8018x family. manual organization the z8018x family user manual is divided into five sections, seven appendices, and an index. part family z80180 z80180 z8s180 z8s180 z8l180 z8l180 z80181 z80180 z80182 z80180, z8s180* z80s183 z8s180 z80185/195 z8s180 z80189 z8s180 * part number-dependant
z8018x family mpu user manual um005001-zmp0400 iv sections z8018x mpu operation presents features, a general description, pins descriptions, block diagrams, registers, and details of operating modes for the z8018x mpus. software architecture provides instruction sets and cpu registers for the z8018x mpus. dc characteristics presents the dc parameters and absolute maximum ratings for the z8x180 mpus. ac characteristics presents the ac parameters for the z8018x mpus. timing diagrams contains timing diagrams and standard test conditions for the z8018x mpus. appendices the appendixes in this manual provide additional information applicable to the z8018x family of zilog mpus: ? instruction set ? instruction summary table ? op code map ? bus control signal conditions in each machine cycle and interrupt conditions ? operating mode summary ? status signals ? i/o registers and ordering information
z8018x family mpu user manual um005001-zmp0400 v table of contents z80180, z8s180, z8l180 mpu operation . . . . . . . . . . . . . . . . . . . . 1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 operation modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 cpu timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 wait state generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 halt and low power operation modes (z80180-class processors only) . . . . . . . . . . . . . . . . . . . . . . . . 31 low power modes (z8s180/z8l180 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 add-on features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 standby mode exit wiht bus request . . . . . . . . . . . . . . . . . 38 standby mode exit with external interrupts . . . . . . . . . . . . . . . 39 idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 standby-quick recovery mode . . . . . . . . . . . . . . . . . . . . 41 internal i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 mmu register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 interrupt acknowledge cycle timings . . . . . . . . . . . . . . . . . . . . . . 82 interrupt sources during reset . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 dynamic ram refresh control . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 dma controller (dmac) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 asynchronous serial communication interface (asci) . . . . . . . . 115
z8018x family mpu user manual um005001-zmp0400 vi baud rate generator (z8s180/z8l180-class processors only) . . . . . . . . . . . . . . . 143 clocked serial i/o port (csi/o) . . . . . . . . . . . . . . . . . . . . . . . . . . 146 csi/o registers description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 programmable reload timer (prt) . . . . . . . . . . . . . . . . . . . . . . . 156 miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 absolute maximum rating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 z80180 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 z8s180 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 z8l180 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 ac characteristics?z8s180 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 timing diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 standard test conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 restart address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
z8018x family mpu user manual um005001-zmp0400 vii flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 data manipulation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 data transfer instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 program and control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 special control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 instruction summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 op code map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 bus control signal conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 bus and control signal condition in each machine cycle . . . . . . . . . 251 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 operating modes summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 request acceptances in each operating mode . . . . . . . . . . . . . . . . . . 281 request priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 operation mode transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 other operation mode transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 status signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 pin outputs in each operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . 287 pin status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 internal i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
z8018x family mpu user manual um005001-zmp0400 ix list of figures z80180, z8s180, z8l180 mpu operation . . . . . . . . . . . . . . . . . . . . 1 figure 1. 64-pin dip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 figure 2. 68-pin plcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 figure 3. 80-pin qfp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 figure 4. z80180/z8s180/z8l180 block diagram . . . . . . . . . . . . . . . 6 figure 5. operation mode control register . . . . . . . . . . . . . . . . . . . . 15 figure 6. m1 temporary enable timing . . . . . . . . . . . . . . . . . . . . . . 16 figure 7. i/o read and write cycles with ioc = 1 timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 figure 8. i/o read and write cycles with ioc = 0 timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 figure 9. op code fetch (without wait state) timing diagram . . . . 19 figure 10. op code fetch (with wait state) timing diagram . . . . . . 20 figure 11. memory read/write (without wait state) timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 12. memory read/write (with wait state) timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 13. i/o read/write timing diagram . . . . . . . . . . . . . . . . . . . . 23 figure 14. instruction timing diagram . . . . . . . . . . . . . . . . . . . . . . . . 24 figure 15. reset timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 figure 16. bus exchange timing during memory read . . . . . . . . . . . 26 figure 17. bus exchange timing during cpu internal operation . . . 27 figure 18. wait timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 figure 19. memory and i/o wait state insertion (dcntl ? dma/wait control register) . . . . . . . . . . . . . . 29 figure 20. halt timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
z8018x family mpu user manual um005001-zmp0400 x figure 21. sleep timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 35 figure 22. i/o address relocation . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 figure 23. logical address mapping examples . . . . . . . . . . . . . . . . . 55 figure 24. physical address transition . . . . . . . . . . . . . . . . . . . . . . . 56 figure 25. mmu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 figure 26. i/o address translation . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 figure 27. logical memory organization . . . . . . . . . . . . . . . . . . . . . 58 figure 28. logical space configuration . . . . . . . . . . . . . . . . . . . . . . . 59 figure 29. physical address generation . . . . . . . . . . . . . . . . . . . . . . . 64 figure 30. physical address generation 2 . . . . . . . . . . . . . . . . . . . . . 64 figure 31. interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 figure 32. trap timing diagram -2nd op code undefined . . . . . . 71 figure 33. trap timing - 3rd op code undefined . . . . . . . . . . . . . 72 figure 34. nmi use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 figure 35. nmi timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 figure 36. int0 mode 0 timing diagram . . . . . . . . . . . . . . . . . . . . . 76 figure 37. int0 mode 1 interrupt sequence . . . . . . . . . . . . . . . . . . . 77 figure 38. int0 mode 1 timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 figure 39. int0 mode 2 vector acquisition . . . . . . . . . . . . . . . . . . . 79 figure 40. int0 interrupt mode 2 timing diagram . . . . . . . . . . . . . 80 figure 41. int1 , int2 vector acquisition . . . . . . . . . . . . . . . . . . . . 81 figure 42. reti instruction sequence . . . . . . . . . . . . . . . . . . . . . . . . 84 figure 43. int1, int2 and internal interrupts timing diagram . . . . 86 figure 44. refresh cycle timing diagram . . . . . . . . . . . . . . . . . . . . . 87 figure 45. dmac block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 figure 46. dma timing diagram-cycle steal mode . . . . . . . 106 figure 47. cpu operation and dma operation dreq0 is programmed for level-sense . . . . . . . . . . . . . . . . . . . 107 figure 48. cpu operation and dma operation dreq0 is programmed for edge-sense . . . . . . . . . . . . . . . . . . . . 108
z8018x family mpu user manual um005001-zmp0400 xi figure 49. tend0 output timing diagram . . . . . . . . . . . . . . . . . . . 108 figure 50. dma interrupt request generation . . . . . . . . . . . . . . . . . 114 figure 51. nmi and dma operation timing diagram . . . . . . . . . . . 115 figure 52. asci block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 figure 53. dcd0 timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 139 figure 54. rts0 timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 figure 55. asci interrupt request circuit diagram . . . . . . . . . . . . . 140 figure 56. asci clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 figure 57. csi/o block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 figure 58. csi/o interrupt request generation . . . . . . . . . . . . . . . . . 151 figure 59. transmit timing diagram?internal clock . . . . . . . . . . . . 153 figure 60. transmit timing?external clock . . . . . . . . . . . . . . . . . . . 154 figure 61. csi/o receive timing?internal clock . . . . . . . . . . . . . . . 155 figure 62. csi/o receive timing?external clock . . . . . . . . . . . . . . 156 figure 63. prt block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 figure 64. timer initialization, count down, and reload timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 figure 65. timer output timing diagram . . . . . . . . . . . . . . . . . . . . . 164 figure 66. prt interrupt request generation . . . . . . . . . . . . . . . . . . 164 figure 67. e clock timing diagram (during read/write cycle and interrupt acknowledge cycle . . . . . . . . . . . . . . . . . . 167 figure 68. e clock timing in bus release mode . . . . . . . . . . . . 167 figure 69. e clock timing in sleep mode and system stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 figure 70. external clock interface . . . . . . . . . . . . . . . . . . . . . . . . . . 169 figure 71. clock generator circuit . . . . . . . . . . . . . . . . . . . . . . . . . . 170 figure 72. circuit board design rules . . . . . . . . . . . . . . . . . . . . . . . 170 figure 73. example of board design . . . . . . . . . . . . . . . . . . . . . . . . . 171
z8018x family mpu user manual um005001-zmp0400 xii software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 figure 74. cpu register configurations . . . . . . . . . . . . . . . . . . . . . 176 figure 75. register direct ? bit field definitions . . . . . . . . . . . . . 181 figure 76. register indirect addressing . . . . . . . . . . . . . . . . . . . . . . 181 figure 77. indexed addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 figure 78. extended addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 figure 79. immediate addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 figure 80. relative addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 timing diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 figure 81. ac timing diagram 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 figure 82. ac timing diagram 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 figure 83. cpu timing ( ioc = 0) (i/o read cycle, i/o write cycle) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 figure 84. dma control signals . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 figure 85. e clock timing (memory r/w cycle) (i/o r/w cycle) 201 figure 86. e clock timing (bus release mode, sleep mode, and system stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . 201 figure 87. e clock timing (minimum timing example of pwel and pweh) 202 figure 88. timer output timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 figure 89. slp execution cycle timing diagram . . . . . . . . . . . . . . 203 figure 90. csi/o receive/transmit timing diagram . . . . . . . . . . . 204 figure 91. external clock rise time and fall time . . . . . . . . . . . . 204 figure 92. input rise time and fall time (except extal, reset ) . . . . . . . . . . . . . . . . . . . . . . . . 204 figure 93. test setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
z8018x family mpu user manual um005001-zmp0400 xiv list of tables z80180, z8s180, z8l180 mpu operation . . . . . . . . . . . . . . . . . . . . 1 table 1. status summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 table 2. multiplexed pin descriptions . . . . . . . . . . . . . . . . . . . . . . . 12 table 3. memory wait states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 table 4. wait state insertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 table 5. power-down modes (z8s180/z8l180-class processor only) . . . . . . . . . . . . . . 37 table 6. i/o address map for z80180-class processors only . . . . . 44 table 7. i/o address map (z8s180/z8l180-class processors only) . . . . . . . . . . . . . 48 table 8. state of ief1 and ief2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 table 9. vector table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 table 10. reti control signal states . . . . . . . . . . . . . . . . . . . . . . . . . 85 table 11. dram refresh intervals . . . . . . . . . . . . . . . . . . . . . . . . . . 89 table 12. channel 0 destination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 table 13. channel 0 source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 table 14. transfer mode combinations . . . . . . . . . . . . . . . . . . . . . . . 99 table 15. channel 1 transfer mode . . . . . . . . . . . . . . . . . . . . . . . . . 102 table 16. dma transfer request . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 table 17. data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 table 18. divide ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 table 19. asci baud rate selection . . . . . . . . . . . . . . . . . . . . . . . . . 142 table 20. clock mode bit values . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 table 21. 2^ss values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 table 22. csi/o baud rate selection . . . . . . . . . . . . . . . . . . . . . . . . 150
z8018x family mpu user manual um005001-zmp0400 xv table 23. timer output control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 table 24. e clock timing in each condition . . . . . . . . . . . . . . . . . . 166 table 25. z8x180 operating frequencies . . . . . . . . . . . . . . . . . . . . 169 software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 table 26. instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . 173 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 table 27. absolute maximum rating . . . . . . . . . . . . . . . . . . . . . . . . 185 table 28. z80180 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . 186 table 29. z8s180 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . 187 table 30. z8l180 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . 189 ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 table 31. z8s180 ac characteristics . . . . . . . . . . . . . . . . . . . . . . . 193 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 table 32. register values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 table 33. bit values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 table 34. instruction values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 table 35. address values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 table 36. flag conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 table 37. operations mnemonics . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 table 38. arithmetic and logical instructions (8-bit) . . . . . . . . . . . . 211 table 39. rotate and shift instructions . . . . . . . . . . . . . . . . . . . . . . . 216 table 40. arithmetic instructions (16-bit) . . . . . . . . . . . . . . . . . . . . . 221 table 41. 8-bit load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 table 42. 16-bit load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
z8018x family mpu user manual um005001-zmp0400 xvi table 43. block transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 table 44. stock and exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 table 45. program control instructions . . . . . . . . . . . . . . . . . . . . . . 229 table 46. i/o instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 table 47. special control instructions . . . . . . . . . . . . . . . . . . . . . . . 235 op code map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 table 48. 1st op code map instruction format: xx . . . . . . . . . . . 247 table 49. 2nd op code map instruction format: cb xx . . . . . . . 249 table 50. 2nd op code map instruction format: ed xx . . . . . . . 250 bus control signal conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 table 51. bus and control signal condition in each machine cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 table 52. interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 operating modes summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 table 53. request acceptances in each operating mode . . . . . . . . 281 table 54. the z80180 types of requests . . . . . . . . . . . . . . . . . . . . 282 status signals 287 table 55. pin outputs in each operating mode . . . . . . . . . . . . . . . . 287 table 56. pin status during reset and low power operation modes . . . . . . . . . . . . . . . . 289 i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 table 57. internal i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
z8018x family mpu user manual um005001-zmp0400 xv
z8018x family mpu user manual 1 um005001-zmp0400 z80180, z8s180, z8l180 mpu operation features ? operating frequency to 33 mhz ? on-chip mmu supports extended address space ? two dma channels ? on-chip wait state generators ? two universal asynchronous receiver/transmitter (uart) channels ? two 16-bit timer channels ? on-chip interrupt controller ? on-chip clock oscillator/generator ? clocked serial i/o port ? code compatible with zilog z80 cpu ? extended instructions general description based on a microcoded execution unit and an advanced cmos manufacturing technology, the z80180, z8s180, z8l180 (z8x180) is an 8-bit mpu which provides the benefits of reduced system costs and low power operation while offering higher performance and maintaining compatibility with a large base of industry standard software written around the zilog z8x cpu. higher performance is obtained by virtue of higher operating frequencies, reduced instruction execution times, an enhanced instruction set, and an
z8018x family mpu user manual 2 um005001-zmp0400 on-chip memory management unit (mmu) with the capability of addressing up to 1 mb of memory. reduced system costs are obtained by incorporating several key system functions on-chip with the cpu. these key functions include i/o devices such as dma, uart, and timer channels. also included on-chip are several glue functions such as dynamic ram refresh control, wait state generators, clock oscillator, and interrupt controller. not only does the z8x180 consume a low amount of power during normal operation, but processors with z8s180 and z8l180 class processors also provides two operating modes that are designed to drastically reduce the power consumption even further. the sleep mode reduces power by placing the cpu into a stopped state, thereby consuming less current, while the on-chip i/o device is still operating. the system stop mode places both the cpu and the on-chip peripherals into a stopped state, thereby reducing power consumption even further. when combined with other cmos vlsi devices and memories, the z8x180 provides an excellent solution to system applications requiring high performance, and low power operation. figures 1 through 3 illustrate the three pin packages in the z8x180 mpu family: ? 64-pin dual in-line package (dip), figure 1 ? 68-pin plastic leaded chip carrier (plcc), figure 2 ? 80-pin quad flat pack (qfp), figure 3 pin out package descriptions for other z8x180-based products are covered in their respective product specifications. figure 4 depicts the block diagram that is shared throughout all configurations of the z8x180.
z8018x family mpu user manual um005001-zmp0400 3 figure 1. 64-pin dip v ss xtal extal wait busack busreq reset nmi int0 int1 int2 st a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18/tout v cc 1 2 3 4 6 7 8 9 10 5 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 64 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 63 62 61 60 59 58 57 56 phi rd wr mi e mreq iorq rfsh halt tend1 dreq1 cks rxs/cts1 txs cka1/tend0 rxa1 txa1 cka0/dreq0 rxa0 txa0 dco0 cts0 rts0 d7 d6 d5 d4 d3 d2 d1 d0 v ss z8x180
z8018x family mpu user manual 4 um005001-zmp0400 figure 2. 68-pin plcc a 1 5 a 1 6 a 1 7 a 1 8 / t o u t v c c a 1 9 v s s d 0 d 1 d 2 d 3 d 4 d 5 d 6 2 7 2 8 2 9 3 0 3 2 3 3 3 4 3 5 3 6 3 1 3 7 3 8 3 9 4 0 4 1 4 2 4 3 60 51 50 49 48 47 46 45 44 59 58 57 56 55 54 53 52 halt tend1 dreq1 cks rxs/ cts1 txs cka1/t end0 rxa1 test txa1 cka0/ dreq0 rxa0 txa0 dcd0 cts0 rts0 d7 z8x180 a 1 2 a 1 3 a 1 4 9 6 8 6 7 6 6 6 5 6 4 6 3 6 2 6 1 8 7 6 5 4 3 2 1 n m i r e s e t b u s r e q b u s a c k w a i t e x t a l x t a l v s s v l s p h i r d w r m i e m r e q i o r q r f s h st a0 a1 a2 a3 v ss a4 a5 a6 a7 a8 a9 a10 a11 10 11 12 13 15 16 17 18 19 14 20 21 22 23 24 25 26 int0 int1 int2
z8018x family mpu user manual um005001-zmp0400 5 figure 3. 80-pin qfp z8x180 st a0 a1 a2 a3 v ss a4 nc a5 a6 a7 1 2 3 4 6 7 8 9 10 5 11 12 13 14 15 16 17 nmi int1 int2 a8 18 a9 19 a10 20 a11 21 nc 22 nc 23 a12 24 int0 nc nc 64 63 62 61 59 58 57 56 55 60 54 53 52 51 50 49 48 47 46 45 44 43 42 41 cks rxs/cts1 txs cka1/ tend0 rxa1 test txa1 nc cka0/ dreq0 rxa0 txa0 rfsh tend1 dreq1 dcd0 cts rts0 d7 nc nc d6 halt nc nc a 1 8 / t o u t v c c a 1 9 v s s d 0 d 1 d 2 d 3 d 4 a 1 3 a 1 7 n c a 1 6 a 1 4 a 1 5 d 5 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 x t a l v c c v s s p h i r d w r m i e m r e q r e s e t e x t a l n c w a i t b u s r e q b u s a c k i o r q 8 0 7 9 7 8 7 7 7 6 7 5 7 4 7 3 7 2 7 1 7 0 6 9 6 8 6 7 6 6 6 5
z8018x family mpu user manual 6 um005001-zmp0400 figure 4. z80180/z8s180/z8l180 block diagram mmu address buffer data buffer a0 ? a19 d0 ? df asynchronous sci (channel 0) cpu dmacs (2) dreq1 tend1 cka0/ dreq0 interrupt bus state control asynchronous sci (channel 0) r e s e t r d w r m i m r e q i o r q h a l t w a i t b u s r e q b u s a c k r f s h s t e n m i i n t 0 i n t 1 i n t 2 rxa0 rts0 cts0 dcd0 txa0 txa1 cka1/ tend0 rxa1 v cc v ss 16-bit programmable reload timers txs rxs/ cts1 cks a18/ tout clocked serial i/o port timing generator a d d r e s s b u s ( 1 6 - b i t ) x t a l e x t a l phi d a t a b u s ( 8 - b i t )
z8018x family mpu user manual um005001-zmp0400 7 pin description a0 ? a19. address bus (output, active high, 3-state). a0 ? a19 form a 20- bit address bus. the address bus provides the address for memory data bus exchanges, up to 1 mb, and i/o data bus exchanges, up to 64k. the address bus enters a high impedance state during reset and external bus acknowledge cycles. address line a18 is multiplexed with the output of prt channel 1 (tout, selected as address output on reset) and address line a19 is not available in dip versions of the z8x180. busack . bus acknowledge (output, active low). busack indicates that the requesting device, the mpu address and data bus, and some control signals, have entered their high impedance state. busreq . bus request (input, active low). this input is used by external devices (such as dma controllers) to request access to the system bus. this request has a higher priority than nmi and is always recognized at the end of the current machine cycle. this signal stops the cpu from executing further instructions and places the address and data buses, and other control signals, into the high impedance state. cka0, cka1. asynchronous clock 0 and 1 (bidirectional, active high). these pins are the transmit and receive clocks for the asci channels. cka0, is multiplexed with dre q0 and cka1 is multiplexed with tend 0 . cks. serial clock (bidirectional, active high). this line is the clock for the csio channel. clock (phi). system clock (output, active high). the output is used as a reference clock for the mpu and the external system. the frequency of this output is equal to one-half that of the crystal or input clock frequency. cts 0 , cts 1 . clear to send 0 and 1 (inputs, active low). these lines are modem control signals for the asci channels. cts 1 is multiplexed with rxs.
z8018x family mpu user manual 8 um005001-zmp0400 d0 ? d7. data bus (bidirectional, active high, 3-state). d0-d7 constitute an 8-bit bidirectional data bus, used for the transfer of information to and from i/o and memory devices. the data bus enters the high impedance state during reset and external bus acknowledge cycles. dcd 0 . data carrier detect 0 (input, active low). this input is a programmable modem control signal for asci channel 0. dreq 0 , dreq 1 . dma request 0 and 1 (input, active low). dreq is used to request a dma transfer from one of the on-chip dma channels. the dma channels monitor these inputs to determine when an external device is ready for a read or write operation. these inputs can be programmed to be either level- or edge-sensed. dreq 0 is multiplexed with cka0. e. enable clock (output, active high). synchronous machine cycle clock output during bus transactions. extal. external clock/crystal (input, active high). crystal oscillator connection. an external clock can be input to the z8x180 on this pin when a crystal is not used. this input is schmitt-triggered. halt . halt/sleep status (output, active low). this output is asserted after the cpu has executed either the halt or slp instruction, and is waiting for either non-maskable or maskable interrupt before operation can resume. halt is also used with the m 1 and st signals to decode status of the cpu machine cycle. int 0 . maskable interrupt request 0 (input, active low). this signal is generated by external i/o devices. the cpu honors this request at the end of the current instruction cycle as long as the nmi and busreq signals are inactive. the cpu acknowledges this interrupt request with an interrupt acknowledge cycle. during this cycle, both the m 1 and iorq signals become active. int 1 , int 2 . maskable interrupt requests 1 and 2 (inputs, active low) . this signal is generated by external i/o devices. the cpu honors these requests at the end of the current instruction cycle as long as the nmi ,
z8018x family mpu user manual um005001-zmp0400 9 busreq , and int 0 signals are inactive. the cpu acknowledges these interrupt requests with an interrupt acknowledge cycle. unlike the acknowledgment for int 0 , during this cycle neither the m 1 or iorq signals become active. iorq . i/o request (output, active low, 3-state). iorq indicates that the address bus contains a valid i/o address for an i/o read or i/o write operation. iorq is also generated, along with m 1 , during the acknowledgment of the int 0 input signal to indicate that an interrupt response vector can be placed onto the data bus. this signal is analogous to the ioe signal of the z64180. m 1 . machine cycle 1 (output, active low). together with mreq , m 1 indicates that the current cycle is the op code fetch cycle of an instruction execution. together with iorq , m 1 indicates that the current cycle is for an interrupt acknowledge. it is also used with the halt and st signal to decode status of the cpu machine cycle. this signal is analogous to the lir signal of the z64180. mreq . memory request (output, active low, 3-state). mreq indicates that the address bus holds a valid address for a memory read or memory write operation. this signal is analogous to the me signal of the z64180. nmi . non-maskable interrupt (input, negative edge triggered). nmi has a higher priority than int and is always recognized at the end of an instruction, regardless of the state of the interrupt enable flip-flops. this signal forces cpu execution to continue at location 0066h . rd . read (output active low, 3-state). rd indicates that the cpu wants to read data from memory or an i/o device. the addressed i/o or memory device must use this signal to gate data onto the cpu data bus. rfsh . refresh (output, active low). together with mreq , rfsh indicates that the current cpu machine cycle and the contents of the address bus must be used for refresh of dynamic memories. the low order 8 bits of the address bus (a7 ? a0) contain the refresh address. this signal is analogous to the ref signal of the z64180.
z8018x family mpu user manual 10 um005001-zmp0400 rts 0 . request to send 0 (output, active low). this output is a programmable modem control signal for asci channel 0. rxa0, rxa1. receive data 0 and 1 (inputs, active high). these signals are the receive data to the asci channels. rxs. clocked serial receive data (input, active high). this line is the receiver data for the csio channel. rxs is multiplexed with the cts 1 signal for asci channel 1. st. status (output, active high). this signal is used with the m1 and halt output to decode the status of the cpu machine cycle. table1 provides status summary. tend 0 , tend 1 . transfer end 0 and 1 (outputs, active low). this output is asserted active during the last write cycle of a dma operation. it is used to indicate the end of the block transfer. tend 0 in multiplexed with cka1. test. test (output, not on dip version). this pin is for test and must be left open. table 1. status summary st halt m1 operation 0 1 0 cpu operation (1st op code fetch) 1 1 0 cpu operation (2nd op code and 3rd op code fetch) 1 1 1 cpu operation (mc 2 except for op code fetch) 0 x 1 1 dma operation 0 0 0 halt mode 1 0 1 sleep mode (including system stop mode) 1. x = don't care 2. mc = machine cycle
z8018x family mpu user manual um005001-zmp0400 11 tout . timer out (output, active high). tout is the pulse output from prt channel 1. this line is multiplexed with a18 of the address bus. txa0, txa1. transmit data 0 and 1 (outputs, active high). these signals are the transmitted data from the asci channels. transmitted data changes are with respect to the falling edge of the transmit clock. txs. clocked serial transmit data (output, active high). this line is the transmitted data from the csio channel. wait . wait (input; active low). wait indicates to the cpu that the addressed memory or i/o devices are not ready for a data transfer. this input is used to induce additional clock cycles into the current machine cycle. the wait input is sampled on the falling edge of t2 (and subsequent wait states). if the input is sampled low, then additional wait states are inserted until the wait input is sampled high, at which time execution continues. wr . write (output, active low, 3-state). wr indicates that the cpu data bus holds valid data to be stored at the addressed i/o or memory location. xtal. crystal (input, active high). crystal oscillator connection. this pin must be left open if an external clock is used instead of a crystal. the oscillator input is not a ttl level (reference dc characteristics). multiplexed pins are described in table2.
z8018x family mpu user manual 12 um005001-zmp0400 architecture the z8x180 combines a high performance cpu core with a variety of system and i/o resources useful in a broad range of applications. the cpu core consists of five functional blocks: clock generator, bus state controller (including dynamic memory refresh), interrupt controller, memory management unit (mmu), and the central processing unit (cpu). the integrated i/o resources make up the remaining four functional blocks: ? direct memory access (dma) control (2 channels) ? asynchronous serial communications interface (asci, 2 channels), table 2. multiplexed pin descriptions multiplexed pins descriptions a18/tout during reset, this pin is initialized as a18 pin. if either toc1 or toc0 bit of the timer control register (tcr) is set to 1, tout function is selected. if toc1 and toc0 bits are cleared to 0, a18 function is selected. cka0/ dreq0 during reset, this pin is initialized as cka 0 pin. if either dm1 or sm1 in dma mode register (dmode) is set to 1, dreq0 function is always selected. cka1/ tend0 during reset, this pin is initialized as cka1 pin. if cka1d bit in asci control register ch 1 (cntla1) is set to 1, tend0 function is selected. if cka1d bit is set to 0, cka1 function is selected. rxs/ cts1 during reset, this pin is initialized as rxs pin. if cts1e bit in asci status register ch 1 (stat1) is set to 1, cts1 function is selected. if cts1e bit is 0, rxs function is selected.
z8018x family mpu user manual um005001-zmp0400 13 ? programmable reload timers (prt, 2 channels) ? clock serial i/o (csio) channel. other z8x180 family members (such as z80183, z80s183, z80185/195) feature, in addition to these blocks, additional peripherals and are covered in their associated product specification clock generator this logic generates the system clock from either an external crystal or clock input. the external clock is divided by two and provided to both internal and external devices. bus state controller this logic performs all of the status and bus control activity associated with both the cpu and some on-chip peripherals. this includes wait state timing, reset cycles, dram refresh, and dma bus exchanges. interrupt controller this block monitors and prioritizes the variety of internal and external interrupts and traps to provide the correct responses from the cpu. to remain compatible with the z80 cpu, three different interrupt modes are supported. memory management unit the mmu allows the user to map the memory used by the cpu (logically only 64k) into the 1mb addressing range supported by the z8x180. the organization of the mmu object code features compatibility with the z80 cpu while offering access to an extended memory space. this capability is accomplished by using an effective common area - banked area scheme.
z8018x family mpu user manual 14 um005001-zmp0400 central processing unit the cpu is microcoded to provide a core that is object code compatible with the z80 cpu. it also provides a superset of the z80 instruction set, including 8-bit multiply and divide. this core has been enhanced to allow many of the instructions to execute in fewer clock cycles. dma controller the dma controller provides high speed transfers between memory and i/o devices. transfer operations supported are memory-to-memory, memory to/from i/o and i/o to i/o. transfer modes supported are request, burst, and cycle steal. dma transfers can access the full 1mb addressing range with a block length up to 64kb, and can cross over 64k boundaries. asynchronous serial communications interface (asci) the asci logic provides two individual full-duplex uarts. each channel includes a programmable baud rate generator and modem control signals. the asci channels can also support a multiprocessor communications format. programmable reload timer (prt) this logic consists of two separate channels, each containing a 16-bit counter (timer) and count reload register. the time base for the counters is derived from the system clock (divided by 20) before reaching the counter. prt channel 1 provides an optional output to allow for waveform generation. clocked serial i/o (csio) the csio channel provides a half-duplex serial transmitter and receiver. this channel can be used for simple high-speed data connection to another microprocessor or microcomputer.
z8018x family mpu user manual um005001-zmp0400 15 operation modes the z8x180 can be configured to operate like the hitachi hd64180. this functionality is accomplished by allowing user control over the m 1 , iorq , wr , and rd signals. the operation mode control register (omcr), illustrated in figure 5, determines the m 1 options, the timing of the iorq , rd , and wr signals, and the reti operation. figure 5. operation mode control register m1e (m1 enable ): this bit controls the m1 output and is set to a 1 during reset. when m1e is 1 , the m 1 output is asserted low during the op code fetch cycle, the int0 acknowledge cycle, and the first machine cycle of the nmi acknowledge. this action also causes the m1 signal to be active during both fetches of the reti instruction sequence, and may cause corruption of the external interrupt daisy chain. therefore, this bit must be 0 for the z8x180. when m1e is 0 the m 1 output is normally inactive and asserted low only during the refetch of the reti instruction sequence and the int 0 acknowledge cycle (figure 6). operation mode control register bit 7 6 5 4 0 bit/field m1e m1te ioc reserved r/w r/w w r/w ? reset 1 1 1 ? note: r = read w = write x = indeterminate? = not applicable
z8018x family mpu user manual 16 um005001-zmp0400 figure 6. m1 temporary enable timing m1te (m1 temporary enable): this bit controls the temporary assertion of the m1 signal. it is always read back as a 1 and is set to 1 during reset. this function is used to arm the internal interrupt structure of the z80pio. when a control word is written to the z80pio to enable interrupts, no enable actually takes place until the pio sees an active m 1 signal. when m1te is 1 , there is no change in the operation of the m 1 signal and m1e controls its function. when m1te is 0 , the m 1 output is asserted during the next op code fetch cycle regardless of the state programmed into the m1e bit. this situation is only momentary (one time) and the user need not reprogram a 1 to disable the function (see figure 7). ioc : this bit controls the timing of the iorq and rd signals. ioc is set to 1 by reset. when ioc is 1 , the iorq and rd signals function the same as the hd64180. phi wr m1 write into omcr op code fetch t3 t2 t1 t1 t2 t3
z8018x family mpu user manual um005001-zmp0400 17 figure 7. i/o read and write cycles with ioc = 1 timing diagram when ioc is 0 , the timing of the iorq and rd signals match the timing required by the z80 family of peripherals. the iorq and rd signals go active as a result of the rising edge of t2. this timing allows the z8x180 to satisfy the setup times required by the z80 peripherals on those two signals (figure ). figure 8. i/o read and write cycles with ioc = 0 timing diagram for the remainder of this document, assume that m1e is 0 and ioc is 0 . t1 phi t2 tw t3 iorq rd wr t1 phi t2 tw t3 iorq rd wr
z8018x family mpu user manual 18 um005001-zmp0400 the user must program the operation mode control register before the first i/o instruction is executed. cpu timing this section explains the z8x180 cpu timing for the following operations: ? instruction (op code) fetch timing ? operand and data read/write timing ? i/o read/write timing ? basic instruction (fetch and execute) timing ? reset timing ? busreq / busack bus exchange timing the basic cpu operation consists of one or more machine cycles (mc). a machine cycle consists of three system clocks, t1, t2, and t3 while accessing memory or i/o, or it consists of one system clock (t1) during cpu internal operations. the system clock is half the frequency of the crystal oscillator (that is, an 8-mhz crystal produces 4 mhz or 250 nsec). for interfacing to slow memory or peripherals, optional wait states (tw) may be inserted between t2 and t3. instruction (op code) fetch timing figure 9 illustrates the instruction (op code) fetch timing with no wait states. an op code fetch cycle is externally indicated when the m 1 output pin is low. in the first half of t1, the address bus (a0 ? a19) is driven from the contents of the program counter (pc). this address bus is the translated address output of the z8x180 on-chip mmu. in the second half of t1, the mreq . (memory request) and rd (read) signals are asserted low, enabling the memory. note:
z8018x family mpu user manual um005001-zmp0400 19 the op code on the data bus is latched at the rising edge of t3 and the bus cycle terminates at the end of t3. figure 9. op code fetch (without wait state) timing diagram figure 10 illustrates the insertion of wait states (tw) into the op code fetch cycle. wait states (tw) are controlled by the external wait input combined with an on-chip programmable wait state generator. at the falling edge of t2 the combined wait input is sampled. if wait input is asserted low, a wait state (tw) is inserted. the address bus, mreq , rd and m 1 are held stable during wait states. when wait is sampled inactive high at the falling edge of tw, the bus cycle enters t3 and completes at the end of t3. t1 t3 t1 t2 t2 phi a0 ? a19 d0 ? d7 m1 mreq rd wait
z8018x family mpu user manual 20 um005001-zmp0400 figure 10. op code fetch (with wait state) timing diagram operand and data read/write timing the instruction operand and data read/write timing differs from op code fetch timing in two ways: ? the m 1 output is held inactive ? the read cycle timing is relaxed by one-half clock cycle because data is latched at the falling edge of t3 instruction operands include immediate data, displacement, and extended addresses, and contain the same timing as memory data reads. during memory write cycles the mreq signal goes active in the second half of t1. at the end of t1, the data bus is driven with the write data. at the start of t2, the wr signal is asserted low enabling the memory. mreq and wr go inactive in the second half of t3 followed by disabling of the write data on the data bus. t1 t2 t2 tw tw t3 t1 phi a0 ? a19 d0 ? d7 m1 mreq rd wait op code
z8018x family mpu user manual um005001-zmp0400 21 wait states (tw) are inserted as previously described for op code fetch cycles. figure 11 illustrates the read/write timing without wait states (tw), while figure 12 illustrates read/write timing with wait states (tw). figure 11. memory read/write (without wait state) timing diagram t1 t1 t2 t3 t1 t2 t3 phi a0 ? a19 d0 ? d7 wr mreq rd wait read cycle write cycle memory address memory address write data read data
z8018x family mpu user manual 22 um005001-zmp0400 figure 12. memory read/write (with wait state) timing diagram i/o read/write timing i/o read/write operations differ from memory read/write operations in the following three ways: ? the iorq (i/o request) signal is asserted low instead of the mreq signal ? the 16-bit i/o address is not translated by the mmu ? a16?a19 are held low at least one wait state (tw) is always inserted for i/o read and write cycles (except internal i/o cycles). figure 13 illustrates i/o read/write timing with the automatically inserted wait state (tw). t1 t1 t2 tw t3 t2 t3 phi a0 ? a19 d0 ? d7 wr mreq rd wait read cycle write cycle tw read data write data
z8018x family mpu user manual um005001-zmp0400 23 figure 13. i/o read/write timing diagram basic instruction timing an instruction may consist of a number of machine cycles including op code fetch, operand fetch, and data read/write cycles. an instruction may also include cycles for internal processes which make the bus idle. the example in figure 14 illustrates the bus timing for the data transfer instruction ld (ix+d),g. t1 t1 t2 tw t3 t2 t3 phi a0 ? a19 d0 ? d7 wr iorq rd wait i/o read cycle i/o write cycle write data tw i/o address i/o address read data
z8018x family mpu user manual 24 um005001-zmp0400 figure 14. instruction timing diagram this instruction moves the contents of a cpu register (g) to the memory location with address computed by adding a signed 8-bit displacement (d) to the contents of an index register (ix). the instruction cycle begins with the two machine cycles to read the two byte instruction op code as indicated by m 1 low. next, the instruction operand (d) is fetched. memory write cycle next instruction fetch cycle cpu internal operation displacement read cycle 2nd op code fetch cycle 1st op code fetch cycle t1 t2 t3 t1 t3 t1 t2 t2 t3 t1 t1 t1 t1 t1 t2 t3 t2 pc+3 ix+d pc+2 pc+1 pc g (7oh ? 77h) (ddh) d mc1 mc2 mc3 mc4 mc5 mc6 mc7 note: d = displacement g = register contents machine cycle wr rd mreq phi a0 ? a19 d0 ? d7 m1
z8018x family mpu user manual um005001-zmp0400 25 the external bus is idle while the cpu computes the effective address. finally, the computed memory location is written with the contents of the cpu register (g). reset timing figure 15 depicts the z8x180 hardware reset timing. if the reset pin is low for six or more clock cycles, processing is terminated and the z8x180 restarts execution from (logical and physical) address 00000h . figure 15. reset timing diagram busreq / busack bus exchange timing the z8x180 can coordinate the exchange of control, address and data bus ownership with another bus master. the alternate bus master can request the bus release by asserting the busreq (bus request) input low. after the z8x180 releases the bus, it relinquishes control to the alternate bus master by asserting the busack (bus acknowledge) output low. the bus may be released by the z8x180 at the end of each machine cycle. in this context, a machine cycle consists of a minimum of three clock cycles (more if wait states are inserted) for op code fetch, memory read/ write, and i/o read/write cycles. except for these cases, a machine cycle corresponds to one clock cycle. phi a0 ? a19 reset reset high impedance restart address (00000h) reset start op code fetch cycle t1 t2 6 or more clocks
z8018x family mpu user manual 26 um005001-zmp0400 when the bus is released, the address (a0 ? a19), data (d0 ? d7), and control ( mreq , iorq , rd , and wr ) signals are placed in the high impedance state. dynamic ram refresh is not performed when the z8x180 has released the bus. the alternate bus master must provide dynamic memory refreshing if the bus is released for long periods of time. figure 16 illustrates busreq / busack bus exchange during a memory read cycle. figure 17 illustrates bus exchange when the bus release is requested during a z8x180 cpu internal operation. busreq is sampled at the falling edge of the system clock prior to t3, t1 and tx (bus release state). if busreq is asserted low at the falling edge of the clock state prior to tx, another tx is executed. figure 16. bus exchange timing during memory read phi a0 ? a19 t1 t1 tx tx t3 tw t2 t1 rd , wr d0 ? d7 mreq iorq busreq busack cpu memory read cycle bus release cycle cpu cycle
z8018x family mpu user manual um005001-zmp0400 27 figure 17. bus exchange timing during cpu internal operation wait state generator to ease interfacing with slow memory and i/o devices, the z8x180 uses wait states (tw) to extend bus cycle timing. a wait state(s) is inserted based on the combined (logical or) state of the external wait input and an internal programmable wait state (tw) generator. wait states (tw) can be inserted in both cpu execution and dma transfer cycles. when the external wait input is asserted low, wait state(s) (tw) are inserted between t2 and t3 to extend the bus cycle duration. the wait input is sampled at the falling edge of the system clock in t2 or tw. if the wait input is asserted low at the falling edge of the system clock in tw, another tw is inserted into the bus cycle. wait input transitions must meet specified setup and hold times. this specification can easily be accomplished by phi a0 ? a19 rd , wr d0 ? d7 mreq iorq busreq busack cpu internal operation bus release cycle cpu cycle t1 t1 t1 tx t1 tx t1 tx note:
z8018x family mpu user manual 28 um005001-zmp0400 externally synchronizing wait input transitions with the rising edge of the system clock. dynamic ram refresh is not performed during wait states (tw) and thus system designs which use the automatic refresh function must consider the affects of the occurrence and duration of wait states (tw). figure 18 depicts wait timing. figure 18. wait timing diagram programmable wait state insertion in addition to the wait input, wait states (tw) can also be inserted by program using the z8x180 on-chip wait state generator (see figure 19. wait state (tw) timing applies for both cpu execution and on-chip dmac cycles. by programming the four significant bits of the dma/wait control register (dcntl) the number of wait states, (tw) automatically inserted in memory and i/o cycles, can be separately specified. bits 4 and 5 specify the number of wait states (tw) inserted for i/o access and bits 6 and 7 specify the number of wait states (tw) inserted for memory access. these bit pairs all 0?3 programmed wait states for either i/o or memory access. t1 phi wait t2 tw tw t3 t1
z8018x family mpu user manual um005001-zmp0400 29 figure 19. memory and i/o wait state insertion (dcntl ? dma/wait control register) the number of wait states (tw) inserted in a specific cycle is the maximum of the number requested by the wait input, and the number automatically generated by the on-chip wait state generator. bit 7, 6: mwi1 mwi0, (memory wait insertion) for cpu and dmac cycles which access memory (including memory mapped i/o), zero to three wait states may be automatically inserted depending on the programmed value in mwi1 and mwi0 as depicted in table3 bit 5, 4: iwi1, iwi0 (i/o wait insertion) for cpu and dma cycles which access external i/o (and interrupt acknowledge cycles), one to six wait states (tw) may be automatically table 3. memory wait states mw11 mwi0 the number of wait states 0 0 0 0 1 1 1 0 2 1 1 3 bit 7 6 5 4 mwi1 mwi0 mwi1 mwi0 r/w r/w r/w r/w
z8018x family mpu user manual 30 um005001-zmp0400 inserted depending on the programmed value in iwi1 and iwi0. refer to table4. wait input and reset during reset, mwi1, mwi0 iwi1 and iwi0, are all 1 , selecting the maximum number of wait states (tw) (three for memory accesses, four for external i/o accesses). table 4. wait state insertion iwi1 iwi0 the number of wait states for external i/o registers accesses for internal i/0 registers accesses for int0 interrupt acknowledge cycles when m1 is low for int1 , int2 and internal interrupts acknowledge cycles (note 2) for nmi interrupt acknowledge cycles when m1 is low (note 2) 0 0 1 0 (note 1) 2 2 0 0 1 2 4 1 0 3 5 1 1 4 6 note: 1. for z8x180 internal i/o register access (i/o addresses 0000h - 003fh ), iwi1 and iwi0 do not determine wait state (tw) timing. for asci, csi/o and prt data register accesses, 0 to 4 wait states (tw) are generated. the number of wait states inserted during access to these registers is a function of internal synchronization requirements and cpu state. all other on-chip i/o register accesses (that is, mmu, dmac, asci control registers, for instance.) have no wait states inserted and thus require only three clock cycles. 2. for interrupt acknowledge cycles in which m 1 is high, such as interrupt vector table read and pc stacking cycle, memory access timing applies.
z8018x family mpu user manual um005001-zmp0400 31 also, the wait input is ignored during reset. for example, if reset is detected while the z8x180 is in a wait state (tw), the wait stated cycle in progress is aborted, and the reset sequence initiated. thus, reset has higher priority than wait . halt and low power operation modes (z80180-class processors only) the z80180 can operate in two different modes: ? halt mode ? iostop mode and two low-power operation modes: ? sleep ? system stop in all operating modes, the basic cpu clock (xtal, extal) must remain active. halt mode halt mode is entered by execution of the halt instruction (op code 76h ) and has the following characteristics: ? the internal cpu clock remains active ? all internal and external interrupts can be received ? bus exchange ( busreq and busack ) can occur ? dynamic ram refresh cycle ( rfsh ) insertion continues at the programmed interval ? i/o operations (asci, csi/o and prt) continue ? the dmac can operate
z8018x family mpu user manual 32 um005001-zmp0400 ? the halt output pin is asserted low ? the external bus activity consists of repeated dummy fetches of the op code following the halt instruction. essentially, the z80180 operates normally in halt mode, except that instruction execution is stopped. halt mode can be exited in the following two ways: ? reset exit from halt mode if the reset input is asserted low for at least six clock cycles, halt mode is exited and the normal reset sequence (restart at address 00000h ) is initiated. ? interrupt exit from halt mode when an internal or external interrupt is generated, halt mode is exited and the normal interrupt response sequence is initiated. if the interrupt source is masked (individually by enable bit, or globally by ief1 state), the z80180 remains in halt mode. however, nmi interrupt initiates the normal nmi interrupt response sequence independent of the state of ief1. halt timing is illustrated in figure 20.
z8018x family mpu user manual um005001-zmp0400 33 . figure 20. halt timing diagram sleep mode sleep mode is entered by execution of the 2-byte slp instruction. sleep mode contains the following characteristics: ? the internal cpu clock stops, reducing power consumption ? the internal crystal oscillator does not stop ? internal and external interrupt inputs can be received ? dram refresh cycles stop ? i/o operations using on-chip peripherals continue ? the internal dmac stop ? busreq can be received and acknowledged ? address outputs go high and all other control signal outputs become inactive high t1 m1 rd mreq phi a0 ? a19 int1 , nmi t3 t1 t2 t3 t1 t2 halt op code halt mode interrupt acknowledge cycle halt halt op code address halt op code address + 1 fetch cycle
z8018x family mpu user manual 34 um005001-zmp0400 ? data bus, 3-state sleep mode is exited in one of two ways as described below. ? reset exit from sleep mode. if the reset input is held low for at least six clock cycles, it exits sleep mode and begins the normal reset sequence with execution starting at address (logical and physical) 00000h . ? interrupt exit from sleep mode. the sleep mode is exited by detection of an external ( nmi , int0 , int2 ) or internal (asci, csi/o, prt) interrupt. in case of nmi , sleep mode is exited and the cpu begins the normal nmi interrupt response sequence. in the case of all other interrupts, the interrupt response depends on the state of the global interrupt enable flag ief1 and the individual interrupt source enable bit. if the individual interrupt condition is disabled by the corresponding enable bit, occurrence of that interrupt is ignored and the cpu remains in the sleep mode. assuming the individual interrupt condition is enabled, the response to that interrupt depends on the global interrupt enable flag (ief1). if interrupts are globally enabled (ief1 is 1 ) and an individually enabled interrupt occurs, sleep mode is exited and the appropriate normal interrupt response sequence is executed. if interrupts are globally disabled (ief1 is 0 ) and an individually enabled interrupt occurs, sleep mode is exited and instruction execution begins with the instruction following the slp instruction. this feature provides a technique for synchronization with high speed external events without incurring the latency imposed by an interrupt response sequence. figure 21 depicts sleep timing.
z8018x family mpu user manual um005001-zmp0400 35 figure 21. sleep timing diagram iostop mode iostop mode is entered by setting the iostop bit of the i/o control register (icr) to 1 . in this case, on-chip i/o (asci, csi/o, prt) stops operating. however, the cpu continues to operate. recovery from iostop mode is by resetting the iostop bit in icr to 0 . system stop mode system stop mode is the combination of sleep and iostop modes. system stop mode is entered by setting the iostop bit in icr to 1 followed by execution of the slp instruction. in this mode, on-chip i/o and cpu stop operating, reducing power consumption. recovery from system stop mode is the same as recovery from sleep mode, noting that internal i/o sources, (disabled by iostop) cannot generate a recovery interrupt. t2 m1 phi a0 ? a19 halt t1 t2 ts ts t1 t2 t3 int1, nmi slp 2nd op code sleep mode op code fetch or interrupt acknowledge cycle fetch cycle slp 2nd op code address fffffh t3
z8018x family mpu user manual 36 um005001-zmp0400 low power modes (z8s180/z8l180 only) the following section is a detailed description of the enhancements to the z8s180/l180 from the standard z80180 in the areas of standby, idle and standby quick recovery modes. add-on features there are five different power-down modes. sleep and system stop are inherited from the z80180. in sleep mode, the cpu is in a stopped state while the on-chip i/os are still operating. in i/o stop mode, the on- chip i/os are in a stopped state while leaving the cpu running. in system stop mode, both the cpu and the on-chip i/os are in the stopped state to reduce current consumption. the z8s180 features two additional power-down modes, standby and idle, to reduce current consumption even further. the differences in these power-down modes are summarized in table5.
z8018x family mpu user manual um005001-zmp0400 37 standby mode the z8s180/z8l180 is designed to save power. two low-power programmable power-down modes have been added: ? standby mode ? idle mode the standby/idle mode is selected by multiplexing bits 1 and 3 of the cpu control register (ccr, i/o address = 1fh ). to enter standby mode: table 5. power-down modes (z8s180/z8l180-class processors only) power- down modes cpu core on-chip i/o osc. clkout recovery source recovery time (minimum) sleep stop running running running reset, interrupts 1.5 clock i/o stop running stop running running by programming ? system stop stop stop running running reset, interrupts 1.5 clock idle ? stop stop running stop reset, interrupts, busreq 8 + 1.5 clock standby ? stop stop stop stop reset, interrupts, busreq 2 17 + 1.5 clock (normal recovery) 2 6 + 1.5 clock (quick recovery) ? idle and standby modes are only offered in the z8s180. the minimum recovery time can be achieved if interrupt is used as the recovery source.
z8018x family mpu user manual 38 um005001-zmp0400 1. set bits 6 and 3 to 1 and 0 , respectively. 2. set the i/o stop bits (bit 5 of icr, i/o address = 3fh ) to 1 . 3. execute the sleep instruction. when the device is in standby mode, it performs similar to the system stop mode as it exists on the z80180-class processors, except that the standby mode stops the external oscillator, internal clocks and reduces power consumption to 50 m a (typical). because the clock oscillator has been stopped, a restart of the oscillator requires a period of time for stabilization. an 18-bit counter has been added in the z8s180z8l180 to allow for oscillator stabilization. when the part receives an external irq or busreq during standby mode, the oscillator is restarted and the timer counts down 2 17 counts before acknowledgment is sent to the interrupt source. the recovery source must remain asserted for the duration of the 2 17 count, otherwise standby restarts. standby mode exit with bus request optionally, if the brext bit (d5 of cpu control register) is set to 1, the z8s180 exits standby mode when the busreq input is asserted. the crystal oscillator is then restarted. an internal counter automatically provides time for the oscillator to stabilize, before the internal clocking and the system clock output of the z8s180 are resumed. the z8s180 relinquishes the system bus after the clocking is resumed by: ? 3-state the address outputs a19?a0 ? 3-state the bus control outputs mreq , iorq , rd , and wr ? asserting busack the z8s180 regains the system bus when busreq is deactivated. the address outputs and the bus control outputs are then driven high. the standby mode is exited.
z8018x family mpu user manual um005001-zmp0400 39 if the brext bit of the cpu control register (ccr) is cleared, asserting the busreq does not cause the z8s180/z8l180-class processors to exit standby mode. if standby mode is exited because of a reset or an external interrupt, the z8s180/z8l180-class processors remains relinquished from the system bus as long as busreq is active. standby mode exit with external interrupts standby mode can be exited by asserting input nmi . the standby mode may also exit by asserting int0 . int1 or int2 , depending on the conditions specified in the following paragraphs. int0 wake-up requires assertion throughout duration of clock stabilization time (2 17 clocks). if exit conditions are met, the internal counter provides time for the crystal oscillator to stabilize, before the internal clocking and the system clock output within the z8s180/z8l180-class processors resume. ? exit with non-maskable interrupts if nmi is asserted, the cpu begins a normal nmi interrupt acknowledge sequence after clocking resumes. ? exit with external maskable interrupts if an external maskable interrupt input is asserted, the cpu responds according to the status of the global interrupt enable flag ief1 (determined by the ite1 bit) and the settings of the corresponding interrupt enable bit in the interrupt/trap control register (itc: i/o address = 34h ). if an interrupt source is disabled in the itc, asserting the corresponding interrupt input does not cause the z8s180/z8l180-class processors to exit standby mode. this condition is true regardless of the state of the global interrupt enable flag ief1.
z8018x family mpu user manual 40 um005001-zmp0400 if the global interrupt enable flag ief1 is set to 1, and if an interrupt source is enabled in the itc, asserting the corresponding interrupt input causes the z8s180/z8l180-class processors to exit standby mode. the cpu performs an interrupt acknowledge sequence appropriate to the input being asserted when clocking is resumed if: ? the interrupt input follows the normal interrupt daisy-chain protocol ? the interrupt source is active until the acknowledge cycle is complete if the global interrupt enable flag ief1 is disabled (reset to 0) and if an interrupt source is enabled in the itc, asserting the corresponding interrupt input still causes the z8s180/z8l180-class processors to exit standby mode. the cpu proceeds to fetch and execute instructions that follow the sleep instruction when clocking resumes. if the extend maskable interrupt input is not active until clocking resumes, the z8s180/z8l180-class processors do not exit standby mode. if the non-maskable interrupt ( nmi ) is not active until clocking resumes, the z8s180/z8l180-class processors still exits the standby mode even if the interrupt sources go away before the timer times out, because nmi is edge-triggered. the condition is latched internally when nmi is asserted low. idle mode idle mode is another power-down mode offered by the z8s180/ z8l180-class processors. 1. set bits 6 and 3 to 0 and 1 , respectively. 2. set the i/o stop bit (bit 5 of icr, i/o address = 3fh to 1. 3. execute the sleep instruction when the part is in idle mode, the clock oscillator is kept oscillating, but the clock to the rest of the internal circuit, including the clkout, is stopped completely. idle mode is exited in a similar way as standby mode, using reset, bus request or external interrupts,
z8018x family mpu user manual um005001-zmp0400 41 except that the 2 17 bit wake-up timer is bypassed. all control signals are asserted eight clock cycles after the exit conditions are gathered. standby-quick recovery mode standby-quick recovery mode is an option offered in standby mode to reduce the clock recovery time in standby mode from 2 17 clock cycles (4 m s at 33 mhz) to 2 6 clock cycles (1.9 m s at 33 mhz). this feature can only be used when providing an oscillator as clock source. to enter standby-quick recovery mode: 1. set bits 6 and 3 to 1 and 1 , respectively. 2. set the i/o stop bit (bit 5 of icr, i/o address = 3fh ) to 1 . 3. execute the sleep instruction when the part is in standby-quick recovery mode, the operation is identical to standby mode except when exit conditions are gathered, using reset, bus request or external interrupts. the clock and other control signals are recovered sooner than the standby mode. if standby-quick recovery is enabled, the user must ensure stable oscillation is obtained within 64 clock cycles internal i/o registers the z8x180 internal i/o registers occupy 64 i/o addresses (including reserved addresses). these registers access the internal i/o modules (asci, csi/o, prt) and control functions (dmac, dram refresh, interrupts, wait state generator, mmu and i/o relocation). note:
z8018x family mpu user manual 42 um005001-zmp0400 to avoid address conflicts with external i/o, the z8x180 internal i/o addresses can be relocated on 64-byte boundaries within the bottom 256 bytes of the 64kb i/o address space. i/o control register (icr) icr allows relocating of the internal i/o addresses. icr also controls enabling/disabling of the iostop mode. i/o control register (icr: 3fh) bit 7 6 5 4 3 2 1 0 bit/field ioa7 ioa6 iostp ? ? ? ? ? r/w r/w r/w r/w reset 0 0 0 r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 ? 6 ioa7:6 r/w ioa7 and ioa6 relocate internal i/o as depicted in figure . the high-order 8 bits of 16-bit internal i/o addresses are always 0. ioa7 and ioa6 are cleared to 0 during reset. 5 iostp r/w iostop mode is enabled when iostp is set to 1. normal. i/o operation resumes when iostp is reset to 0.
z8018x family mpu user manual um005001-zmp0400 43 figure 22. i/o address relocation internal i/o registers address map the internal i/o register addresses are described in table6 and table7. these addresses are relative to the 64-byte boundary base address specified in icr. i/o addressing notes the internal i/o register addresses are located in the i/o address space from 0000h to 00ffh (16-bit i/o addresses). thus, to access the internal i/o registers (using i/o instructions), the high-order 8 bits of the 16-bit i/o address must be 0 . the conventional i/o instructions (out (m), a/in a, (m) / outi/ini, for example) place the contents of a cpu register on the high-order 8 bits of the address bus, and thus may be difficult to use for accessing internal i/o registers. for efficient internal i/o register access, a number of new instructions have been added, which force the high-order 8 bits of the 16-bit i/o ioa7 ? ioa6 = 1 1 ioa7 ? ioa6 = 1 0 ioa7 ? ioa6 = 0 1 ioa7 ? ioa6 = 0 0 00ffh 00c0h 0080h 007fh 0040h 003fh 0000h 00bfh
z8018x family mpu user manual 44 um005001-zmp0400 address to 0 . these instructions are in0, out0, otim, otimr, otdm, otdmr and tstio (see instruction set). when writing to an internal i/o register, the same i/o write occurs on the external bus. however, the duplicate external i/o write cycle exhibits internal i/o write cycle timing. for example, the wait input and programmable wait state generator are ignored. similarly, internal i/o read cycles also cause a duplicate external i/o read cycle. however, the external read data is ignored by the z8x180. normally, external i/o addresses should be chosen to avoid overlap with internal i/o addresses and duplicate i/o accesses. table 6. i/o address map for z80180-class processors only register mnemonic address binary hex page asci asci control register a ch 0 cntla0 xx000000 00h 125 asci control register a ch 1 cntla1 xx000001 01h 128 asci control register b ch 0 cntlb0 xx000010 02h 132 asci control register b ch 1 cntlb1 xx000011 03h 132 asci status register ch 0 stat0 xx000100 04h 120 asci status register ch 1 stat1 xx000101 05h 123 asci transmit data register ch 0 tdr0 xx000110 06h 118 asci transmit data register ch 1 tdr1 xx000111 07h 118 asci receive data register ch 0 rdr0 xx001000 08h 119 asci receive data register ch 1 rdr1 xx001001 09h 119 csi/o csi/o control register cntr xx001010 0ah 147 csi/o transmit/receive data register trd xx1011 0bh 149
z8018x family mpu user manual um005001-zmp0400 45 timer data register ch 0 l tmdr0l xx001100 0ch 159 data register ch 0 h tmdr0h xx001101 0dh 159 reload register ch 0 l rldr0l xx001110 0eh 159 reload register ch 0 h rldr0h xx001111 0fh 159 timer control register tcr xx010000 10h 161 reserved xx010001 11h xx010011 13h data register ch 1 l tmdr1l xx010100 14h 160 data register ch 1 h tmdr1h xx010101 15h 160 reload register ch 1 l rldr1l xx010110 16h 159 reload register ch 1 h rldr1h xx010111 17h 159 others free running counter reserved frc xx011000 18h 172 xx011001 19h xx011111 1fh table 6. i/o address map for z80180-class processors only (continued) register mnemonic address binary hex page
z8018x family mpu user manual 46 um005001-zmp0400 dma dma source address register ch 0l sar0l xx100000 20h 93 dma source address register ch 0h sar0h xx100001 21h 93 dma source address register ch 0b sar0b xx100010 22h 93 dma destination address register ch 0l dar0l xx100011 23h 94 dma destination address register ch 0h dar0h xx100100 24h 94 dma destination address register ch 0b dar0b xx100101 25h 94 dma byte count register ch 0l bcr0l xx100110 26h 94 dma byte count register ch 0h bcr0h xx100111 27h 94 dma memory address register ch 1l mar1l xx101000 28h 94 dma memory address register ch 1h mar1h xx101001 29h 94 dma memory address register ch 1b mar1b xx101010 2ah 94 dma i/0 address register ch 1l iar1l xx101011 2bh 102 dma i/0 address register ch 1h iar1h xx101100 2ch 102 reserved xx101101 2dh dma byte count register ch 1l bcr1l xx101110 2eh 94 dma byte count register ch 1h bcr1h xx101111 2fh 94 dma status register dstat xx110000 30h 95 dma mode register dmode xx110001 31h 97 dma/wait control register dcntl xx110010 32h 101 table 6. i/o address map for z80180-class processors only (continued) register mnemonic address binary hex page
z8018x family mpu user manual um005001-zmp0400 47 int il register (interrupt vector low register) il xx110011 33h 67 int/trap control register itc xx110100 34h 68 reserved xx110101 35h refresh refresh control register rcr xx110110 36h 88 reserved xx110111 37h mmu mmu common base register cbr xx111000 38h 61 mmu bank base register bbr xx111001 39h 62 mmu common/bank area register cbar xx111010 3ah 60 i/o reserved xx111011 3bh xx111101 3dh operation mode control register omcr xx111110 3eh 15 i/o control register icr xx111111 3fh 42 table 6. i/o address map for z80180-class processors only (continued) register mnemonic address binary hex page
z8018x family mpu user manual 48 um005001-zmp0400 table 7. i/o address map (z8s180/z8l180-class processors only) register mnemonic address binary hex page asci asci control register a ch 0 cntla0 xx000000 00h 125 asci control register a ch 1 cntla1 xx000001 01h 128 asci control register b ch 0 cntlb0 xx000010 02h 132 asci control register b ch 1 cntlb1 xx000011 03h 132 asci status register ch 0 stat0 xx000100 04h 120 asci status register ch 1 stat1 xx000101 05h 123 asci transmit data register ch 0 tdr0 xx000110 06h 118 asci transmit data register ch 1 tdr1 xx000111 07h 118 asci receive data register ch 0 rdr0 xx001000 08h 119 asci receive data register ch 1 rdr1 xx001001 09h 119 asci0 extension control register 0 asext0 xx010010 12h 135 asci1 extension control register 1 asext1 xx010011 13h 136 asci0 time constant low astc0l xx011010 1ah 137 asci0 time constant high astc0h xx001011 1bh 137 asci1 time constant low asct1l xx001100 1ch 138 asci1 time constant high asct1h xx001101 1dh 138 csi0 csi0 control register cntr xx001010 0ah 147 csi0 transmit/receive data register trd xx1011 0bh 149
z8018x family mpu user manual um005001-zmp0400 49 timer data register ch 0 l tmdr0l xx001100 0ch 159 data register ch 0 h tmdr0h xx001101 0dh 159 reload register ch 0 l rldr0l xx001110 0eh 159 reload register ch 0 h rldr0h xx001111 0fh 159 timer control register tcr xx010000 10h 161 reserved xx010001 11h data register ch 1 l tmdr1l xx010100 14h 160 data register ch 1 h tmdr1h xx010101 15h 160 reload register ch 1 l rldr1l xx010110 16h 160 reload register ch 1 h rldr1h xx010111 17h 160 others free running counter reserved frc xx011000 18h 172 xx011001 19h xx011111 1dh clock multiplier register cmr xx011110 1eh 52 cpu control register ccr xx011111 1fh 53 table 7. i/o address map (z8s180/z8l180-class processors only) (continued) register mnemonic address binary hex page
z8018x family mpu user manual 50 um005001-zmp0400 dma dma source address register ch 0l sar0l xx100000 20h 93 dma source address register ch 0h sar0h xx100001 21h 93 dma source address register ch 0b sar0b xx100010 22h 93 dma destination address register ch 0l dar0l xx100011 23h 94 dma destination address register ch 0h dar0h xx100100 24h 94 dma destination address register ch 0b dar0b xx100101 25h 94 dma byte count register ch 0l bcr0l xx100110 26h 94 dma byte count register ch 0h bcr0h xx100111 27h 94 dma memory address register ch 1l mar1l xx101000 28h 94 dma memory address register ch 1h mar1h xx101001 29h 94 dma memory address register ch 1b mar1b xx101010 2ah 94 dma i/o address register ch 1l iar1l xx101011 2bh 102 dma i/o address register ch 1h iar1h xx101100 2ch 102 dma i/o address register ch 1 iar1b xx101101 2dh 94 dma byte count register ch 1l bcr1l xx101110 2eh 94 dma byte count register ch 1h bcr1h xx101111 2fh 94 dma status register dstat xx110000 30h 95 dma mode register dmode xx110001 31h 97 dma/wait control register dcntl xx110010 32h 101 table 7. i/o address map (z8s180/z8l180-class processors only) (continued) register mnemonic address binary hex page
z8018x family mpu user manual um005001-zmp0400 51 int il register (interrupt vector low register) il xx110011 33h 67 int/trap control register itc xx110100 34h 68 reserved xx110101 35h refresh refresh control register rcr xx110110 36h 88 reserved xx110111 37h mmu mmu common base register cbr xx111000 38h 61 mmu bank base register bbr xx111001 39h 62 mmu common/bank area register cbar xx111010 3ah 60 i/o reserved xx111011 3bh xx111101 3dh operation mode control register omcr xx111110 3eh 15 i/o control register icr xx111111 3fh 42 table 7. i/o address map (z8s180/z8l180-class processors only) (continued) register mnemonic address binary hex page
z8018x family mpu user manual 52 um005001-zmp0400 clock multiplier register (cmr: 1eh) (z8s180/l180-class processors only) bit 7 6 0 bit/field x2 reserved r/w r/w ? reset 0 1 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 x2 clock multiplier mode r/w 0 1 x2 clock multiplier mode disable enable 6 ? 0 reserved ? ? reserved
z8018x family mpu user manual um005001-zmp0400 53 cpu control register (ccr: 1fh) (z8s180/l180-class processors only) bit 7 6 5 4 3 2 1 0 bit/field clock divide stand by/ idle enable brext lnphi stand by/ idle enable lnio lncpu ctl lnad/ data r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 clock divide r/w 0 1 xtal/2 xtal/1 6 standby /idle mode r/w 00 01 10 11 in conjunction with bit 3 no standby idle after sleep standby after sleep standby after sleep 64 cycle exit (quick recovery) 5 brext r/w 0 1 ignore busreq in standby/idle standby/idle exit on busreq 4 lnphi r/w 0 1 standard drive 33% drive on extphi clock 3 standby /idle mode r/w 00 01 10 11 in conjunction with bit 6 no standby idle after sleep standby after sleep standby after sleep 64 cycle exit (quick recovery)
z8018x family mpu user manual 54 um005001-zmp0400 memory management unit (mmu) the z8x180 features an on-chip mmu which performs the translation of the cpu 64kb (16-bit addresses 0000h to ffffh ) logical memory address space into a 1024kb (20-bit addresses 00000h to fffffh ) physical memory address space. address translation occurs internally in parallel with other cpu operation. logical address spaces the 64kb cpu logical address space is interpreted by the mmu as consisting of up to three separate logical address areas, common area 0, bank area, and common area 1. as depicted in figure 23, a variety of logical memory configurations are possible. the boundaries between the common and bank areas can be programmed with 4kb resolution. 2 lnio r/w 0 1 standard drive 33% drive on certain external i/o 1 lncpuctl r/w 0 1 standard drive 33% drive on cpu control signals 0 lnad/ data r/w 0 1 standard drive 33% drive on a10?a0, d7?d0 bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 55 figure 23. logical address mapping examples logical to physical address translation figure 24 illustrates an example in which the three logical address space portions are mapped into a 1024kb physical address space. the important points to note are that common and bank areas can overlap and that common area 1 and bank area can be freely relocated (on 4kb physical address boundaries). common area 0 (if it exists) is always based at physical address 00000h . common bank area common common bank common common common area 1 area 0 area 1 area 1 area area 1 area 0
z8018x family mpu user manual 56 um005001-zmp0400 figure 24. physical address transition mmu block diagram the mmu block diagram is depicted in figure 25. the mmu translates internal 16-bit logical addresses to external 20-bit physical addresses. figure 25. mmu block diagram logical address space physical address space common area 1 bank area common area 0 common base bank base ffffh 0000h fffffh 00000h 0 + + + x y z z y x mmu common/bank area register; cbar (8) memory management 8 pa12?pa19 la12?la15 4 mmu common base register; cbr (8) mmu bank base register; bbr (8) la: logical address pa: physical address internal address/data bus unit
z8018x family mpu user manual um005001-zmp0400 57 whether address translation (figure 26) takes place depends on the type of cpu cycle as follows. ? memory cycles address translation occurs for all memory access cycles including instruction and operand fetches, memory data reads and writes, hardware interrupt vector fetch, and software interrupt restarts. ? i/o cycles the mmu is logically bypassed for i/o cycles. the 16-bit logical i/o address space corresponds directly with the 16-bit physical i/o address space. the four high-order bits (a16?a19) of the physical address are always 0 during i/o cycles. figure 26. i/o address translation ? dma cycles when the z8x180 on-chip dmac is using the external bus, the mmu is physically bypassed. the 20-bit source and destination registers in the dmac are directly output on the physical address bus (a0?a19). mmu registers three mmu registers are used to program a specific configuration of logical and physical memory. la15 pa19 la0 pa16 pa15 pa0 ?0000? logical address physical address
z8018x family mpu user manual 58 um005001-zmp0400 ? mmu common/bank area register (cbar) ? mmu common base register (cbr) ? mmu bank base register (bbr) cbar is used to define the logical memory organization, while cbr and bbr are used to relocate logical areas within the 1024kb physical address space. the resolution for both setting boundaries within the logical space and relocation within the physical space is 4kb. the ca field of cbar determines the start address of common area 1 (upper common) and by default, the end address of the bank area. the ba field determines the start address of the bank area and by default, the end address of common area 0 (lower common). the ca and ba fields of cbar may be freely programmed subject only to the restriction that ca may never be less than ba. figures 27 and 28 illustrate examples of logical memory organizations associated with different values of ca and ba. figure 27. logical memory organization common bank area common common bank area common common common common area 1 lower limit address > bank area lower limit address > 0000h common area 1 lower limit address > bank area lower limit address = 0000h common area 1 lower limit address = bank area lower limit address > 0000h common area 1 lower limit address = bank area lower limit address = 0000h (reset condition) area 1 area 1 area 0 area 1 area 1 area 0
z8018x family mpu user manual um005001-zmp0400 59 figure 28. logical space configuration (example) mmu common/bank area register mmu common/bank area register d7 ffffh d000h cfffh 4000h 3fffh 0000h d 4 d6 d5 d4 d3 d2 d1 d0 d5 1 1 0 1 0 1 0 0 bank area common area 1 common area 0
z8018x family mpu user manual 60 um005001-zmp0400 mmu register description mmu common/bank area register (cbar) cbar specifies boundaries within the z8x180 64kb logical address space for up to three areas; common area 0, bank area and common area 1. mmu common/bank area register (cbar: 3ah) bit 7 6 5 4 3 2 1 0 bit/field ca3 ca2 ca1 ca0 ba3 ba2 ba1 ba0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 1 1 1 1 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 ? 4 ca7 ? 4 r/w ca specifies the start (low) address (on 4kb boundaries) for the common area 1. this also determines the last address of the bank area. 3 ? 0 ba3 ? 0 r/w ba specifies the start (low) address (on 4kb boundaries) for the bank area. this also determines the last address of the common area 0.
z8018x family mpu user manual um005001-zmp0400 61 mmu common base register (cbr) cbr specifies the base address (on 4k boundaries) used to generate a 20- bit physical address for common area 1 accesses. all bits of cbr are reset to 0 during reset. mmu common base register (cbr: 38h) bit 7 6 5 4 3 2 1 0 bit/field cb7 cb6 cb5 cb4 cb3 cb2 cb1 cb0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 ? 0 cb7 ? 0 r/w cbr specifies the base address (on 4kb boundaries) used to generate a 20-bit physical address for common area 1 accesses.
z8018x family mpu user manual 62 um005001-zmp0400 mmu bank base register (bbr) bbr specifies the base address (on 4kb boundaries) used to generate a 20-bit physical address for bank area accesses. all bits of bbr are reset to 0 during reset. physical address translation figure 29 illustrates the way in which physical addresses are generated based on the contents of cbar, cbr and bbr. mmu comparators classify an access by logical area as defined by cbar. depending on which of the three potential logical areas (common area 1, bank area, or common area 0) is being accessed, the appropriate 8- or 7-bit base address is added to the high-order 4 bits of the logical address, yielding a 19- or 20-bit physical address. cbr is associated with common area 1 accesses. common area 0, if defined, is always based at physical address 00000h . mmu bank base register (bbr: 39h) bit 7 6 5 4 3 2 1 0 bit/field bb7 bb6 bb5 bb4 bb3 bb2 bb1 bb0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 ? 0 bb7 ? 0 r/w bbr specifies the base address (on 4kb boundaries) used to generate a 20-bit physical address for bank area accesses.
z8018x family mpu user manual um005001-zmp0400 63 mmu and reset during reset, all bits of the ca field of cbar are set to 1 while all bits of the ba field of cbar, cbr and bbr are reset to 0 . the logical 64kb address space corresponds directly with the first 64kb 0000h to ffffh ) of the 1024kb 00000h . to fffffh ) physical address space. thus, after reset, the z8x180 begins execution at logical and physical address 0. mmu register access timing when data is written into cbar, cbr or bbr, the value is effective from the cycle immediately following the i/o write cycle which updates these registers. during mmu programming insure that cpu program execution is not disrupted. the next cycle following mmu register programming is normally an op code fetch from the newly translated address. one technique is to localize all mmu programming routines in a common area that is always enabled.
z8018x family mpu user manual 64 um005001-zmp0400 figure 29. physical address generation figure 30. physical address generation 2 adder comparator d3 ? d0 d7 ? d4 0 12 11 15 8 4 4 4 mmu common/ bank area register mmu common/ register bank area mmu common base reg. mmu bank base reg. 0 0 0 0 0 0 0 0 4 8 logical address (64k) physical (512 k or 1 m) (19) 18 12 11 0 address logical address (64 k) 11 12 15 (7) 4 3 0 (19) 18 16 15 12 11 base register (8 bit) physical address 0 0 (1 m)
z8018x family mpu user manual um005001-zmp0400 65 packages not containing an a19 pin or situations using tout instead of a18 yield an address capable of only addressing 512k of physical space. interrupts the z8x180 cpu has twelve interrupt sources, 4 external and 8 internal, with fixed priority. (reference figure 31.) this section explains the cpu registers associated with interrupt processing, the trap interrupt, interrupt response modes, and the external interrupts. the detailed discussion of internal interrupt generation (except trap) is presented in the appropriate hardware section (that is, prt, dmac, asci, and csi/o). figure 31. interrupt sources interrupt control registers and flags. the z8x180 has three registers and two flags which are associated with interrupt processing. note: higher priority lower priority (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) trap (undefined op code trap) nmi (non maskable interrupt) int0 (maskable interrupt level 0) int1 (maskable interrupt level 1) int2 (maskable interrupt level 2) timer 0 timer 1 dma channel 0 dma channel 1 clocked serial i/o port asynchronous sci channel 0 asynchronous sci channel 1 internal interrupt external interrupt internal interrupt
z8018x family mpu user manual 66 um005001-zmp0400 interrupt vector register (i) mode 2 for int0 external interrupt, int1 and int2 external interrupts, and all internal interrupts (except trap) use a programmable vectored technique to determine the address at which interrupt processing starts. in response to the interrupt a 16-bit address is generated. this address accesses a vector table in memory to obtain the address at which execution restarts. while the method for generation of the least significant byte of the table address differs, all vectored interrupts use the contents of i as the most significant byte of the table address. by programming the contents of i, vector tables can be relocated on 256 byte boundaries throughout the 64kb logical address space. i is read/written with the ld a, i and ld i, a instructions rather than i/o (in, out) instructions. i is initialized to 00h during reset. interrupt vector low register this register determines the most significant three bits of the low-order byte of the interrupt vector table address for external interrupts int1 and int2 and all internal interrupts (except trap). the five least significant bits are fixed for each specific interrupt source. by programming il, the function name access method interrupt vector high i ld a,i and ld i, a instructions interrupt vector low il i/o instruction (addr = 33h) interrupt/trap control itc i/o instruction (addr = 34h) interrupt enable flag 1,2 ief1, ief2 el and di note:
z8018x family mpu user manual um005001-zmp0400 67 vector table can be relocated on 32 byte boundaries. il is initialized to 00h during reset. int/trap control register (itc) itc is used to handle trap interrupts and to enable or disable the external maskable interrupt inputs int0 , int1 and int2 . interrupt vector low register (il: 33h) bit 7 6 5 4 3 2 1 0 bit/field il7 il6 il5 ? r/w r/w r/w r/w ? reset 00h 00h 00h ? note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 ? 5 il7 ? 5 r/w the il register is an internal i/o register which is programmed with the out0 instruction and can be read using the in0 instruction. 4 ? 0 ? n/a interrupt source dependent code
z8018x family mpu user manual 68 um005001-zmp0400 interrupt enable flag 1,2 (ief1, ief2) ief1 controls the overall enabling and disabling of all internal and external maskable interrupts (that is, all interrupts except nmi and trap. int/trap control register (itc: 34h) bit 7 6 5 4 3 2 1 0 bit/field trap ufo ? ite2 ite1 ite0 r/w r/w r n/a r/w r/w r/w reset 0 0 0 0 0 1 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 trap r/w this bit is set to 1 when an undefined op code is fetched. trap can be reset under program control by writing it with 0, however, it cannot be written with 1 under program control. 6 ufo r undefined fetch object (bit 6). when a trap interrupt occurs the contents of ufo allow determination of the starting address of the undefined instruction. this action is necessary since the trap may occur on either the second or third byte of the op code. ufo allows the stacked pc value to be correctly adjusted. if ufo = 0, the first op code should be interpreted as the stacked pc-1. if ufo = 1, the first op code address is stacked pc-2. 2 ? 0 ite2 ? 0 r/w interrupt enable ? ite2, ite1 and ite0 enable and disable the external interrupt inputs int2 , int1 and int0 , respectively. if reset to 0, the interrupt is masked.
z8018x family mpu user manual um005001-zmp0400 69 if ief1 is 0 , all maskable interrupts are disabled. ief1 can be reset to 0 by the di (disable interrupts) instruction and set to 1 by the el (enable interrupts) instruction. the purpose of ief2 is to correctly manage the occurrence of nmi . during nmi , the prior interrupt reception state is saved and all maskable interrupts are automatically disabled (ief1 copied to ief2 and then ief1 cleared to 0 ). at the end of the nmi interrupt service routine, execution of the retn (return from non-maskable interrupt) automatically restores the interrupt receiving state (by copying ief2 to ief1) prior to the occurrence of nmi . table8 describes how the ief2 state can be reflected in the p/v bit of the cpu status register by executing ld a, i or ld a, r instructions. table 8. state of ief1 and ief2 cpu operation ief1 ief2 remarks reset 0 0 inhibits the interrupt except nmi and trap. nmi 0 ief1 copies the contents of ief1 to ief2 retn ief2 not affected returns from the nmi service routine. interrupt except nmi end trap 0 0 inhibits the interrupt except nmi end trap reti not affected not affected trap not affected not affected ei 1 1
z8018x family mpu user manual 70 um005001-zmp0400 trap interrupt the z8x180 generates a non-maskable (not affected by the state of ief1) trap interrupt when an undefined op code fetch occurs. this feature can be used to increase software reliability, implement an extended instruction set, or both. trap may occur during op code fetch cycles and also if an undefined op code is fetched during the interrupt acknowledge cycle for int 0 when mode 0 is used. when a trap interrupt occurs the z8x180 operates as follows: 1. the trap bit in the interrupt trap/control (itc) register is set to 1 . 2. the current pc (program counter) value, reflecting location of the undefined op code, is saved on the stack. 3. the z8x180 vectors to logical address 0. note that if logical address 0000h is mapped to physical address 00000h . the vector is the same as for reset. in this case, testing the trap bit in itc reveals whether the restart at physical address 00000h was caused by reset or trap. the state of the ufo (undefined fetch object) bit in itc allows trap manipulation software to correctly adjust the stacked pc, depending on whether the second or third byte of the op code generated the trap. if ufo is 0 , the starting address of the invalid instruction is equal to the di 0 0 ld a, i not affected not affected transfers the contents of ief1 to p/v lid a, r not affected not affected transfers the contents of ief1 to p/v table 8. state of ief1 and ief2 (continued) cpu operation ief1 ief2 remarks
z8018x family mpu user manual um005001-zmp0400 71 stacked pc-1. if ufo is 1 , the starting address of the invalid instruction is equal to the stacked pc-2. bus release cycle, refresh cycle, dma cycle, and wait cycle cannot be inserted just after ttp state which is inserted for trap interrupt sequence. figure depicts trap timing - 2nd op code undefined and figure illustrates trap timing - 3rd op code undefined. figure 32. trap timing diagram -2nd op code undefined 2nd op code fetch cycle pc stacking restart from 0000h op code fetch cycle pc sp-1 sp-2 0000h undefined op code ti ti ti t1 ti ti t1 t2 t3 t2 t3 t1 t2 t3 t1 t2 t3 phi a0 ? a19 wr rd mreq d0 ? d7 mi pch pcl
z8018x family mpu user manual 72 um005001-zmp0400 figure 33. trap timing - 3rd op code undefined external interrupts the z8x180 features four external hardware interrupt inputs: ? nmi ?non-maskable interrupt ? int0 ?maskable interrupt level 0 ? int1 ?maskable interrupt level 1 ? int2 ?maskable interrupt level 2 nmi , int 1 , and int 2 feature fixed interrupt response modes. int 0 has 3 different software programmable interrupt response modes?mode 0, mode 1 and mode 2. nmi - non-maskable interrupt the nmi interrupt input is edge-sensitive and cannot be masked by software. when nmi is detected, the z8x180 operates as follows: phi a0 ? a19 wr rd mreq d0 ? d7 mi ti t1 ti ti t1 t2 t3 t2 t3 t1 t3 t1 t2 t3 t1 t2 ttp t1 t2 t3 memory pc stacking restart from 0000h op code fetch cycle 0000h sp-1 sp-2 pcl pch ix+d, iy+d pc 3rd op code fetch cycle undefined op code read cycle
z8018x family mpu user manual um005001-zmp0400 73 1. dmac operation is suspended by the clearing of the dme (dma main enable) bit in dcntl. 2. the pc is pushed onto the stack. 3. the contents of ief1 are copied to ief2. this saves the interrupt reception state that existed prior to nmi . 4. ief1 is cleared to 0 . this disables all external and internal maskable interrupts (that is, all interrupts except nmi and trap). 5. execution commences at logical address 0066h . the last instruction of an nmi service routine must be retn (return from non-maskable interrupt). this restores the stacked pc, allowing the interrupted program to continue. furthermore, retn causes ief2 to be copied to ief1, restoring the interrupt reception state that existed prior to nmi . nmi , because it can be accepted during z8x180 on-chip dmac operation, can be used to externally interrupt dma transfer. the nmi service routine can reactivate or abort the dmac operation as required by the application. for nmi , take special care to insure that interrupt inputs do not overrun the nmi service routine. unlimited nmi inputs without a corresponding number of retn instructions eventually cause stack overflow. figure 34 depicts the use of nmi and retn while figure 35 details nmi response timing. nmi is edge sensitive and the internally latched nmi falling edge is held until it is sampled. if the falling edge of nmi is latched before the falling edge of the clock state prior to t3 or t1 in the last machine cycle, the internally latched nmi is sampled at the falling edge of the clock state prior to t3 or t1 in the last machine cycle and nmi acknowledge cycle begins at the end of the current machine cycle. note:
z8018x family mpu user manual 74 um005001-zmp0400 figure 34. nmi use main program nmi ef1 0 pch ef1 pcl pcl pch nmi interrupt service program 0066h retn ? (sp-2) ? (sp-1) ? ef1 ? ef2 ? ef2 ? (sp) ? (sp+1) phi a0 ? a19 wr rd mreq d0 ? d7 mi pch pcl instruction last mc nmi acknowledge cycle pc is pushed onto stack restart from 0066h op code fetch pc sp-1 sp-2 0066h nmi t1 t3 ti t1 t1 t2 t3 t1 t2 t3 t1 t1 t2 t3
z8018x family mpu user manual um005001-zmp0400 75 figure 35. nmi timing int0 - maskable interrupt level 0 the next highest priority external interrupt after nmi is int0 . int0 is sampled at the falling edge of the clock state prior to t3 or t1 in the last machine cycle. if int0 is asserted low at the falling edge of the clock state prior to t3 or t1 in the last machine cycle, int0 is accepted. the interrupt is masked if either the ief1 flag or the iteo (interrupt enable 0) bit in itc are reset to 0 . after reset the state is as follows: 1. ief1 is 0 , so int 0 is masked 2. ite0 is 1 , so int 0 is enabled by execution of the el (enable interrupts) instruction the int0 interrupt is unique in that 3 programmable interrupt response modes are available - mode 0, mode 1 and mode 2. the specific mode is selected with the im 0, im 1 and im 2 (set interrupt mode) instructions. during reset , the z8x180 is initialized to use mode 0 for int0 . the 3 interrupt response modes for int0 are: ? mode 0?instruction fetch from data bus ? mode 1?restart at logical address 0038h ? mode 2?low-byte vector table address fetch from data bus int0 mode 0 during the interrupt acknowledge cycle, an instruction is fetched from the data bus (do ? d7) at the rising edge of t3. often, this instruction is one of the eight single byte rst (restart) instructions which stack the pc and restart execution at a fixed logical address. however, multibyte instructions can be processed if the interrupt acknowledging device can provide a multibyte response. unlike all other interrupts, the pc is not automatically stacked:
z8018x family mpu user manual 76 um005001-zmp0400 the trap interrupt occurs if an invalid instruction is fetched during mode 0 interrupt acknowledge. (reference figure 36.) figure 36. int0 mode 0 timing diagram int0 mode 1 when int0 is received, the pc is stacked and instruction execution restarts at logical address 0038h . both ief1 and ief2 flags are reset to 0 , note: phi a0 ? a19 wr rd mreq d0 ? d7 m1 iorq t1 t3 ti ti tw t2 t1 t2 t3 t1 t2 t3 tw pc is pushed onto stack rst instruction execution int0 acknowledge cycle last mc pc sp-1 sp-2 pch pcl rst instruction mc: machine cycle *two wait states are automatically inserted * * int0
z8018x family mpu user manual um005001-zmp0400 77 disabling all maskable interrupts. the interrupt service routine normally terminates with the ei (enable interrupts) instruction followed by the reti (return from interrupt) instruction, to reenable the interrupts. figure 37 depicts the use of int0 (mode 1) and reti for the mode 1 interrupt sequence. figure 37. int0 mode 1 interrupt sequence figure 38 illustrates int0 mode 1 timing. int0 (mode 1) main program 0 pch pcl pcl pch interrupt service program 0038h reti ? (sp-2) ? (sp-1) ? ef1, ef2 ? (sp) ? (sp+1) e1 (1 ? 1ef1, 1ef2) int0 (mode 1)
z8018x family mpu user manual 78 um005001-zmp0400 figure 38. int0 mode 1 timing int0 mode 2 this method determines the restart address by reading the contents of a table residing in memory. the vector table consists of up to 128 two-byte restart addresses stored in low byte, high byte order. phi a0 ? a19 wr rd mreq d0 ? d7 m1 pch pcl pc sp-1 sp-2 0038h int0 t1 t3 tw* t2 t1 t2 t3 t1 t2 t3 t1 t2 t3 tw* last mc pc is pushed onto stack op code fetch cycle int0 acknowledge cycle *two wait states are automatically inserted st iorq
z8018x family mpu user manual um005001-zmp0400 79 the vector table address is located on 256 byte boundaries in the 64kb logical address space programmed in the 8-bit interrupt vector register (1). figure 39 depicts the int0 mode 2 vector acquisition. figure 39. int0 mode 2 vector acquisition during the int0 mode 2 acknowledge cycle, the low-order 8 bits of the vector is fetched from the data bus at the rising edge of t3 and the cpu acquires the 16-bit vector. next, the pc is stacked. finally, the 16-bit restart address is fetched from the vector table and execution begins at that address. external vector acquisition is indicated by both mi and iorq low. two wait states (tw) are automatically inserted for external vector fetch cycles. during reset the interrupt vector register (i) is initialized to 00h and, if necessary, should be set to a different value prior to the occurrence of a mode 2 int 0 interrupt. figure illustrates int0 interrupt mode 2 timing. vector + 1 vector memory 256 bytes vector table 16-bit vector offset interrupt vector register i 8-bit on data bus high-order 8 bits low-order 8 bits of starting address of starting address note:
z8018x family mpu user manual 80 um005001-zmp0400 figure 40. int0 interrupt mode 2 timing diagram int1 , int2 the operation of external interrupts int1 and int2 is a vector mode similar to int0 mode 2. the difference is that int1 and int2 generate the low-order byte of vector table address using the il (interrupt vector low) register rather than fetching it from the data bus. this difference is a0 ? a19 wr rd mreq d0 ? d7 m1 pc sp-1 sp-2 int0 t1 t3 tw* t2 ti t2 t1 t3 t1 t2 t3 tw* *two wait states are automatically inserted st iorq vector vector+1 vector lower address read pc is pushed onto stack interrupt op code t1 t1 t1 t2 t3 t2 t2 t3 starting address pch pcl starting address starting address (upper address) (lower address) lower vector phi manipulation cycle fetch cycle int0 acknowledge cycle last mc
z8018x family mpu user manual um005001-zmp0400 81 also the interrupt response sequence used for all internal interrupts (except trap). as depicted in figure 41, the low-order byte of the vector table address has the most significant three bits of the software programmable il register while the least significant five bits are a unique fixed value for each interrupt ( int1 , int2 and internal) source: figure 41. int1 , int2 vector acquisition int1 and int2 are globally masked by ief1 is 0 . each is also individually maskable by respectively clearing the ite1 and ite2 (bits 1,2) of the int/trap control register to 0 . during reset, ief1, ite1 and ite2 bits are reset to 0 . internal interrupts internal interrupts (except trap) use the same vectored response mode as int1 and int2 . internal interrupts are globally masked by ief1 is 0 . individual internal interrupts are enabled/disabled by programming each vector + 1 vector 32 bytes vector table 16-bit vector high-order 8 bits low-order 8 bits of starting address of starting address i il fixed code (5 bits) memory
z8018x family mpu user manual 82 um005001-zmp0400 individual i/o (prt, dmac, csi/o, asci) control register. the lower vector of int1 int2 and internal interrupt are summarized in table9. interrupt acknowledge cycle timings figure 43 illustrates int1 , int2 , and internal interrupts timing. int1 and int2 are sampled at the falling edge of the clock state prior to t2 or t1 in the last machine cycle. if int1 or int2 is asserted low at the falling edge of clock state prior to t3 or t1 in the last machine cycle, the interrupt request is accepted. table 9. vector table interrupt source priority il fixed code b7 b6 b5 b4 b3 b2 b1 b0 int1 ? ? ? 0 0 0 0 0 int2 ? ? ? 0 0 0 1 0 prt channel 0 ? ? ? 0 0 1 0 0 prt channel 1 ? ? ? 0 0 1 1 0 dma channel 0 ? ? ? 0 1 0 0 0 dma channel 1 ? ? ? 0 1 0 1 0 csi/o ? ? ? 0 1 1 0 0 asci channel 0 ? ? ? 0 1 1 1 0 asci channel 1 ? ? ? 1 0 0 0 0 highest lowest
z8018x family mpu user manual um005001-zmp0400 83 interrupt sources during reset interrupt vector register (i) all bits are reset to 0 . because i = 0 locates the vector tables starting at logical address 0000h vectored interrupts ( int0 mode 2, int1 , int2 , and internal interrupts) overlap with fixed restart interrupts like reset (0), nmi ( 0066h ), int0 mode 1 ( 0038h ) and rst ( 0000h - 0038h ). the vector table(s) are built elsewhere in memory and located on 256 byte boundaries by reprogramming i with the ld i, a instruction. il register bits 7 - 5 are reset to 0 the il register can be programmed to locate the vector table for int1 , int2 and internal interrupts on 32-byte subboundaries within the 256 byte area specified by i. ief1, ief2 flags reset to 0 . interrupts other than nmi and trap are disabled. itc register ite0 set to 1. ite1, ite2 reset to 0 . int0 can be enabled by the ei instruction, which sets ief1 to 1 . enabling int1 and int2 also requires that the ite1 and ite2 bits be respectively set to 1 by writing to itc. i/o control registers interrupt enable bits reset to 0 . all z8x180 on-chip i/o (prt, dmac, csi/o, asci) interrupts are disabled and can be individually enabled by writing to each i/o control register interrupt enable bit.
z8018x family mpu user manual 84 um005001-zmp0400 return from subroutine (reti) instruction sequence when the edh / 4dh sequence is fetched by the z8x180, it is recognized as the reti instruction sequence. the z8x180 then refetches the reti instruction with four t-states in the edh cycle allowing the z80 peripherals time to decode that cycle (see figure 42). this procedure allows the internal interrupt structure of the peripheral to properly decode the instruction and behave accordingly. the m1e bit of the operation mode control register (omcr) must be set to 0 so that m1 signal is active only during the refetch of the reti instruction sequence. this condition is the desired operation when z80 peripherals are connected to the z8018x. figure 42. reti instruction sequence the reti instruction takes 22 t-states and 10 machine cycles. table10 lists the conditions of all the control signals during this sequence for the rd mreq d0 ? d7 t1 st phi t3 ti ti ti t1 t2 t3 ti t1 t2 t3 t1 t3 t1 t2 t2 pc pc + 1 pc pc + 1 4dh 4dh edh edh m1 (m1e = 0) m1 (m1e = 1) a0 ? a18 (a19) note: reti machine cycles 9 and 10 not shown.
z8018x family mpu user manual um005001-zmp0400 85 z8x180. figure 43 illustrates the int1, int2 and internal interrupts timing. table 10. reti control signal states machine cycle states address data mi rd wr mreq iorq m1e=1 m1e =0 halt st 1 t1-t3 1st op code edh 0 1 0 1 0 1 1 0 2 ti-t3 2nd op code 4dh 0 1 0 1 0 1 1 1 3 t1 don't care 3-state 1 1 1 1 1 1 1 1 4 t1 don't care 3-state 1 1 1 1 1 1 1 1 5 t1 don't care 3-state 1 1 1 1 1 1 1 1 6 t1-t3 1st op code edh 0 1 0 1 0 0 1 1 7 t1 don't care 3-state 1 1 1 1 1 1 1 1 8 t1-t3 2nd op code 4dh 0 1 0 1 0 1 1 1 9 t1-t3 sp data 0 1 0 1 1 1 1 1 10 t1-t3 sp+1 data 0 1 0 1 1 1 1 1 ioc affects the iorq/rd signals. m1e affects the assertion of m1. one state also reflects a 1 while the other reflects a 0
z8018x family mpu user manual 86 um005001-zmp0400 figure 43. int1, int2 and internal interrupts timing diagram dynamic ram refresh control the z8x180 incorporates a dynamic ram refresh control circuit including 8-bit refresh address generation and programmable refresh timing. this circuit generates asynchronous refresh cycles inserted at the programmable interval independent of cpu program execution. for systems which do not use dynamic ram, the refresh function can be disabled. when the internal refresh controller determines that a refresh cycle should occur, the current instruction is interrupted at the first breakpoint between machine cycles. the refresh cycle is inserted by placing the refresh address on a0 ? a7 and the rfsh output is driven low. t1 t1 t1 t1 t1 t1 t2 t2 t2 t2 t2 tw* t3 t3 t3 t3 t3 t3 t2 tw* ti pc stacking vector table read op code fetch cycle int1, int2, internal interrupt acknowledge cycle last mc int1 , 2 a0 ? a19 m1 mreq iorq rd wr pc sp-1 sp-2 vector vector+1 starting address starting starting * two wait states are automatically inserted. d0 ? d7 st mc: machine cycle pcl pch phi address (l) address (h)
z8018x family mpu user manual um005001-zmp0400 87 refresh cycles may be programmed to be either two or three clock cycles in duration by programming the refw (refresh wait) bit in the refresh control register (rcr). the external wait input and the internal wait state generator are not effective during refresh. figure 44 depicts the timing of a refresh cycle with a refresh wait (trw) cycle. figure 44. refresh cycle timing diagram note: * if three refresh cycles are specified, trw is inserted. otherwise, trw is not inserted mc: machine cycle mci refresh cycle mci+1 tr1 trw* tr2 refresh signal (internal signal) refresh address a0 ? a7 mreq rfsh
z8018x family mpu user manual 88 um005001-zmp0400 refresh control register (rcr) the rcr specifies the interval and length of refresh cycles, while enabling or disabling the refresh function. refresh control register (rcr: 36h) bit 7 6 5 4 3 2 1 0 bit/field refe refw ? cyc1 cyc0 r/w r/w r/w ? r/w r/w reset 1 1 ? 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 refe r/w 0 1 refe: refresh enable disables the refresh controller enables refresh cycle insertion. 6 refw r/w 0 1 refresh wait (bit 6) causes the refresh cycle to be two clocks in duration. causes the refresh cycle to be three clocks in duration by adding a refresh wait cycle (trw). 1 ? 0 cyc1 ? 0 r/w cycle interval ? cyc1 and cyc0 specify the interval (in clock cycles) between refresh cycles. in the case of dynamic rams requiring 128 refresh cycles every 2 ms (or 256 cycles in every 4 ms), the required refresh interval is less than or equal to 15.625 m s. thus, the underlined values indicate the best refresh interval depending on cpu clock frequency. cyc0 and cyc1 are cleared to 0 during reset. refer to table11.
z8018x family mpu user manual um005001-zmp0400 89 refresh control and reset after reset, based on the initialized value of rcr, refresh cycles occur with an interval of ten clock cycles and are three clock cycles in duration. dynamic ram refresh operation notes 1. refresh cycle insertion is stopped when the cpu is in the following states: ? during reset ? when the bus is released in response to busreq ? during sleep mode ? during wait states 2. refresh cycles are suppressed when the bus is released in response to busreq . however, the refresh timer continues to operate. thus, the time at which the first refresh cycle occurs after the z8x180 re- acquires the bus depends on the refresh timer and has no timing relationship with the bus exchange. table 11. dram refresh intervals cyc1 cyc0 insertion interval time interval 10 mhz 8 mhz 6 mhz 4 mhz 2.5 mhz 0 0 10 states (1.0 m s)* (1.25 m s)* 1.66 m s 2.5 m s 4.0 m s 0 1 20 states (2.0 m s)* (2.5 m s)* 3.3 m s 5.0 m s 8.0 m s 1 0 40 states (4.0 m s)* (5.0 m s)* 6.8 m s 10.0 m s 16.0 m s 1 1 80 states (8.0 m s)* (10.0 m s)* 13.3 m s 20.0 m s 32.0 m s * calculated interval
z8018x family mpu user manual 90 um005001-zmp0400 3. refresh cycles are suppressed during sleep mode. if a refresh cycle is requested during sleep mode, the refresh cycle request is internally latched (until replaced with the next refresh request). the latched refresh cycle is inserted at the end of the first machine cycle after sleep mode is exited. after this initial cycle, the time at which the next refresh cycle occurs depends on the refresh time and has no timing relationship with the exit from sleep mode. 4. regarding (2) and (3), the refresh address is incremented by one for each successful refresh cycle, not for each refresh request. thus, independent of the number of missed refresh requests, each refresh bus cycle uses a refresh address incremented by one from that of the previous refresh bus cycles. dma controller (dmac) the z8x180 contains a two-channel dma (direct memory access) controller which supports high speed data transfer. both channels (channel 0 and channel 1) feature the following capabilities: ? memory address space memory source and destination addresses can be directly specified anywhere within the 1024kb physical address space using 20-bit source and destination memory addresses. in addition, memory transfers can arbitrarily cross 64kb physical address boundaries without cpu intervention. ? i/o address space i/o source and destination addresses can be directly specified anywhere within the 64kb i/o address space (16-bit source and destination i/o addresses). ? transfer length up to 64kb are transferred based on a 16- bit byte count register.
z8018x family mpu user manual um005001-zmp0400 91 ? dreq input level- and edge-sense dreq input detection are selectable. tend output used to indicate dma completion to external devices. ? transfer rate each byte transfer occurs every 6 clock cycles. wait states can be inserted in dma cycles for slow memory or i/o devices. at the system clock ( f ) = 6 mhz, the dma transfer rate is as high as 1.0 megabytes/second (no wait states). there is an additional feature disc for dma interrupt request by dma end. each channel has the following additional specific capabilities: channel 0 ? memory to memory ? memory to i/o ? memory to memory mapped i/o transfers. ? memory address increment, decrement, no-change ? burst or cycle steal memory to/from memory transfers ? dma to/from both asci channels ? higher priority than dmac channel 1 channel 1 ? memory to/from i/o transfer ? memory address increment, decrement dmac registers each channel of the dmac (channel 0, 1) contains three registers specifically associated with that channel.
z8018x family mpu user manual 92 um005001-zmp0400 channel 0 ? sar0?source address register ? dar0?destination address register ? bcr0?byte count register channel 1 ? mar1 ? memory address register ? iar1?i/o address register ? bcr1?byte count register the two channels share the following three additional registers in common: ? dstat?dma status register ? dmode?dma mode register ? dcntl?dma control register dmac block diagram figure 45 depicts the z8x180 dmac block diagram.
z8018x family mpu user manual um005001-zmp0400 93 figure 45. dmac block diagram dmac register description dma source address register channel 0 (sar0 i/o address = 20h to 22h) specifies the physical source address for channel 0 transfers. the register contains 20 bits and can specify up to 1024kb memory addresses or up to 64kb i/o addresses. channel 0 source can be memory, i/o, or memory mapped i/o. internal address/data bus incrementer/decrementer (16) dma control bus & cpu control tend0 tend1 interrupt request dreq0 dreq1 dma status register : dstat (8) dma mode register : dmode (8) dma/wait control register : dcntl (8) priority & request control dma source address register ch0 : sar0 (20) dma destination address register ch0 : dar0 (20) dma byte count register ch0 : bcr0 (16) dma destination address register ch1 : mar1 (20) dma i/o address register ch1 : iar1 (16) dma byte count register ch1 : bcr1 (16)
z8018x family mpu user manual 94 um005001-zmp0400 dma destination address register channel 0 (dar0 i/o address = 23h to 25h) specifies the physical destination address for channel 0 transfers. the register contains 20 bits and can specify up to 1024kb memory addresses or up to 64kb i/o addresses. channel 0 destination can be memory, i/o, or memory mapped i/o. dma byte count register channel 0 (bcr0 i/o address = 26h to 27h) specifies the number of bytes to be transferred. this register contains 16 bits and may specify up to 64kb transfers. when one byte is transferred, the register is decremented by one. if n bytes are transferred, n is stored before the dma operation. dma memory address register channel 1 (mar1: i/o address = 28h to 2ah) specifies the physical memory address for channel 1 transfers. this address may be a destination or source memory address. the register contains 20 bits and may specify up to 1024kb memory address. dma i/o address register channel 1 (iar1: i/o address = 2bh to 2ch) specifies the i/o address for channel 1 transfers. this address may be a destination or source i/o address. the register contains 16 bits and may specify up to 64kb i/o addresses. dma byte count register channel 1 (bcr1: i/o address = 2eh to 2fh) specifies the number of bytes to be transferred. this register contains 16 bits and may specify up to 64kb transfers. when one byte is transferred, the register is decremented by one.
z8018x family mpu user manual um005001-zmp0400 95 dma status register (dstat) dstat is used to enable and disable dma transfer and dma termination interrupts. dstat also determines dma transfer status, that is, completed or in progress. dma status register (dstat: 30h) bit 7 6 5 4 3 2 1 0 bit/field de1 de0 dwe1 dwe0 die1 die0 ? dme r/w r/w r/w w w r/w r/w ? r reset 0 0 1 1 0 0 ? note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 de1 r/w enable channel 1 ? when de1 = 1 and dme = 1, channel 1 dma is enabled. when a dma transfer terminates (bcr1 = 0), de1 is reset to 0 by the dmac. when de1 = 0 and the dma interrupt is enabled (die1 = 1), a dma interrupt request is made to the cpu. to perform a software write to de1, dwe1 is written with 0 during the same register write access. writing de1 to 0 disables channel 1 dma, but dma is restartable. writing de1 to 1 enables channel 1 dma and automatically sets dme (dma main enable) to 1. de1 is cleared to 0 during reset.
z8018x family mpu user manual 96 um005001-zmp0400 6 de0 r/w enable channel 0 ? when de0 = 1 and dme = 1, channel 0 dma is enabled. when a dma transfer terminates bcr0 = 0), de0: is reset to 0 by the dmac. when de0 = 0 and the dma interrupt is enabled (die0 = 1), a dma interrupt request is made to the cpu. to perform a software write to de0, dwe0 must be written with 0 during the same register write access. writing de0 to 0 disables channel 0 dma. writing de0 to 1 enables channel 0 dma and automatically sets dme (dma main enable) to 1. de0 is cleared to 0 during reset. 5 dwe1 w bit write enable 1 ? when performing any software write to dei, dwe1 must be written with 0 during the same access. dwe1 write value of 0 is not held and dwe1 is always read as 1. 4 dwe0 w bit write enable 0 ? when performing any software write to de0, dwe0 must be written with 0 during the same access. dwe0 write value of 0 is not held and dwe0 is always read as 1. 3 die1 r/w dma interrupt enable channel 1 ? when die1 is set to 1, the termination channel 1 dma transfer (indicated when de1 is 0) causes a cpu interrupt request to be generated. when die1 is 0, the channel 1 dma termination interrupt is disabled. die1 is cleared to 0 during reset. 2 die0 dma interrupt enable channel 0 ? when die0 is set to 1, the termination channel 0 of dma transfer (indicated when de0 is 0) causes a cpu interrupt request to be generated. when die0 is 0, the channel 0 dma termination interrupt is disabled. die0 is cleared to 0 during reset. bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 97 dma mode register (dmode) dmode is used to set the addressing and transfer mode for channel 0. 0 dme r dma main enable ? a dma operation is only enabled when its de bit de0 for channel 0, de1 for channel 1) and the dme bit are set to 1. when nmi occurs, dme is reset to 0, thus disabling dma activity during the nmi interrupt service routine. to restart dma, de0 and/or de1 must be written with 1 (even if the contents are already 1). this action automatically sets dme to 1, allowing dma operations to continue. dme cannot be directly written. it is cleared to 0 by nmi or indirectly set to 1 by setting de0 and/or de1 to 1.dme is cleared to 0 during reset. dma mode register (dmode: 31h) bit 7 6 5 4 3 2 1 0 bit/field ? dm1 dm0 sm1 sm0 mmod ? r/w ? r/w r/w r/w r/w r/w ? reset ? 0 0 0 0 0 ? note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 5 ? 4 dm1:0 r/w destination mode channel 0 ? specifies whether the destination for channel 0 transfers is memory, i/o or memory mapped i/o and the corresponding address modifier. reference table12. bit position bit/field r/w value description
z8018x family mpu user manual 98 um005001-zmp0400 3 ? 2 sm1:0 w source mode channel ? specifies whether the source for channel 0 transfers is memory, i/o, or memory mapped i/o and the corresponding address modifier. reference table13. 1 mmod r/w dma memory mode channel 0 ? when channel 0 is configured for memory to/from memory transfers, the external dreq 0 input is not used to control the transfer timing. instead, two automatic transfer timing modes are selectable - burst (mmod is 1) and cycle steal (mmod is 0). for burst memory to/from memory transfers, the dmac takes control of the bus continuously until the dma transfer completes (as shown by the byte count register is 0). in cycle steal mode, the cpu is given a cycle for each dma byte transfer cycle until the transfer is completed. for channel 0 dma with i/o source or destination, the dreq 0 input times the transfer and thus mmod is ignored. table 12. channel 0 destination dm1 dm0 memory/i/o address increment/decrement 0 0 memory + 1 0 1 memory -1 1 0 memory fixed 1 1 i/o fixed bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 99 table14 describes all dma transfer mode combinations of dm0 dm1, sm0 sm1. because i/o to/from i/o transfers are not implemented, 12 combinations are available. table 13. channel 0 source sm1 sm0 memory/i/o address lncrement/decrement 0 0 memory + 1 0 1 memory -1 1 0 memory fixed 1 1 i/o fixed table 14. transfer mode combinations dm1 dm0 sm1 sm0 transfer mode increment/decrement 0 0 0 0 memory to memory sar0+1, dar0+1 0 0 0 1 memory to memory sar0-1, dar0+1 0 0 1 0 memory* to memory sar0 fixed, dar0+ 1 0 0 1 1 i/o to memory sar0 fixed dar0+1 0 1 0 0 memory to memory sar0+1, dar0-1 0 1 0 1 memory to memory sar0-1,dar0-1 0 1 1 0 memory to memory sar0 fixed, dar0-1 0 1 1 1 i/o to memory sar0 fixed. dar0-1 1 0 0 0 memory to memory* sar0+ 1, dar0 fixed 1 0 0 1 memory to memory* sar0-1, dar0 fixed 1 0 1 0 reserved 1 0 1 1 reserved
z8018x family mpu user manual 100 um005001-zmp0400 dma/wait control register (dcntl) dcntl controls the insertion of wait states into dmac (and cpu) accesses of memory or i/o also, the dma request mode for each dreq dreq 0 and dreq1 ) input is defined as level or edge sense. dcntl also sets the dma transfer mode for channel 1, which is limited to memory to/from i/o transfers. 1 1 0 0 memory to i/o sar0+1, dar0 fixed 1 1 0 1 memory to i/o sar0-1, dar0 fixed 1 1 1 0 reserved 1 1 1 1 reserved note: *: includes memory mapped i/o. table 14. transfer mode combinations dm1 dm0 sm1 sm0 transfer mode increment/decrement
z8018x family mpu user manual um005001-zmp0400 101 dma/wait control register (dcntl: 32h) bit 7 6 5 4 3 2 1 0 bit/field mwi1 mwi0 iwi1 iwi0 dms1 dms0 dim1 dim0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 ? 6 mwi1 ? 0 r/w memory wait insertion ?specifies the number of wait states introduced into cpu or dmac memory access cycles. mwi1 and mwi0 are set to 1 during reset. see section on wait state generator for details. 5 ? 4 iwi1 ? 0 r/w wait insertion ? specifies the number of wait states introduced into cpu or dmac i/o access cycles. iwi1 and iwi0 are set to 1 during reset. see section on wait state generator for details. 3 ? 2 dms1 ? 0 r/w dma request sense ? specifies the dma request sense for channel 0 ( dreq0 ) and channel 1 ( dreq 1) respectively. when reset to 0, the input is level-sense. when set to 1, the input is edge-sense. 1 ? 0 dim1 ? 0 r/w dma channel 1 i/o and memory mode ? specifies the source/destination and address modifier for channel 1 memory to/from i/o transfer modes. reference table15.
z8018x family mpu user manual 102 um005001-zmp0400 table 15. channel 1 transfer mode dim1 dim0 transfer mode address increment/decrement 0 0 memory to i/o mari +1, iar1 fixed 0 1 memory to i/o mari -1, iar1 fixed 1 0 i/o to memory iar1 fixed, mar1+1 1 1 i/o to memory iar1 fixed, mar1-1 dma i/o address register ch. 1 (iar1b: 2dh) (z8s180/l180-class processor only) bit 7 6 5 4 3 2 1 0 bit/field reserved r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 r/w 0 1 alternating channels dma channels are independent toggle between dma channels for same device 6 r/w currently selected dma channel when bit 7 = 1 5 ? 4 reserved r/w 0 reserved. must be 0. 3 r/w 0 1 tout/ dreq is dreq in tout/ dreq is tout out
z8018x family mpu user manual um005001-zmp0400 103 dma register description bit 7 this bit must be set to 1 only when both dma channels are set to take their requests from the same device. if this bit is 1 (it resets to 0), the tend output of dma channel o sets a flip-flop, so that thereafter the device?s request is visible to channel 1, but not visible to channel 0. the internal tend signal of channel 1 clears the ff, so that thereafter, the device?s request is visible to channel 0, but no visible to channel 1. if dma request are from differing sources, dma channel 0 request is forced onto dma channel 1 after tend output of dma channel 0 sets the flop-flop to alternate. bit 6 when both dma channels are programmed to take their requests from the same device, this bit (ff mentioned in the previous paragraph) controls which channel the device?s request is presented to: 0 = dma0, 1 = dma l. when bit 7 is 1, this bit is automatically toggled by the channel end output of the channels. 2-0 r/w 000 001 010 011 111 dma1 ext tout/dreq dma1 asci0 dma1 asci1 dma1 escc dma1 pia27-20 (p1284) bit position bit/field r/w value description
z8018x family mpu user manual 104 um005001-zmp0400 bits 5?3 reserved. must be 0. bits 2?0 with dim1, bit 1 of dcntl, these bits control which request is presented to dma channel 1, as described below: dma operation this section discusses the three dma operation modes for channel 0: ? memory to/from memory ? memory to/from i/o ? memory to/from memory mapped i/o dim1 iar18?16 request routed to dma channel 1 0 0 0 0 0 0 0 000 001 010 011 10x 1x0 111 dreq1 asci0 tx asci1 tx ext cka0/ dreq0 reserved reserved reserved 1 1 1 1 1 1 1 000 001 010 011 10x 1x0 111 ext dreq1 asci0 rx asci1 rx ext cka0/ dreq0 reserved reserved reserved
z8018x family mpu user manual um005001-zmp0400 105 in addition, the operation of channel 0 dma with the on-chip asci (asynchronous serial communication interface) as well as channel 1 dma are described. memory to memory?channel 0 for memory to/from memory transfers, the external dreq0 input is not used for dma transfer timing. rather, the dma operation is timed in one of two programmable modes ? burst or cycle steal. in both modes, the dma operation automatically proceeds until termination (shown by byte count-bcr0) = 0 . in burst mode, the dma operation proceeds until termination. in this case, the cpu cannot perform any program execution until the dma operation is completed. in cycle steal mode, the dma and cpu operation are alternated after each dma byte transfer until the dma is completed. the sequence: ? 1 cpu machine cycle ? dma byte transfer is repeated until dma is completed. figure 46 describes cycle steal mode dma timing.
z8018x family mpu user manual 106 um005001-zmp0400 figure 46. dma timing diagram-cycle steal mode to initiate memory to/from memory dma transfer for channel 0, perform the following operations. 1. load the memory source and destination address into sar0 and dar0 2. specify memory to/from memory mode and address increment/ decrement in the sm0 sm1, dm0 and dm1 bits of dmode. 3. load the number of bytes to transfer in bcr0. 4. specify burst or cycle steal mode in the mmod bit of dcntl. 5. program de0 = 1 (with dwe0 = 0 in the same access) in dstat and the dma operation starts one machine cycle later. if interrupt occurs at the same time, the die0 bit must be set to 1 . t1 t2 t1 t2 t1 t2 t1 t3 t3 t3 t2 t3 t1 t2 dma cycle cpu cycle dma cycle (transfer 1 byte) cpu cycle dma cycle ld g,m op code source memory destination memory ld g,m operand wr mreq address data rd m read data phi write data, m address address address address
z8018x family mpu user manual um005001-zmp0400 107 memory to i/o (memory mapped i/o) ? channel 0 for memory to/from i/o (and memory to/from memory mapped i/o) the dreq 0 input is used to time the dma transfers. in addition, the tend0 (transfer end) output is used to indicate the last (byte count register bcr0 = 00h ) transfer. the dreq0 input can be programmed as level- or edge-sensitive. when level-sense is programmed, the dma operation begins when dreq 0 is sampled low. if dreq 0 is sampled high, after the next dma byte transfer, control is relinquished to the z8x180 cpu. as illustrated in figure 47, dreq 0 is sampled at the rising edge of the clock cycle prior to t3, (that is, either t2 or tw). figure 47. cpu operation and dma operation dreq0 is programmed for level-sense when edge-sense is programmed, dma operation begins at the falling edge of dreq 0 if another falling edge is detected before the rising edge of the clock prior to t3 during dma write cycle (that is t2 or tw), the dmac continues operating. if an edge is not detected, the cpu is given control after the current byte dma transfer completes. the cpu continues operating until a dreq 0 falling edge is detected before the tw t1 t2 t3 tw tw tw t1 t1 t1 t2 t2 t2 t3 t3 t3 dma cpu dma dma ** ** ** ** dreq0 is sampled at dreq0 phi write cycle machine cycle read cycle write cycle (i/o)
z8018x family mpu user manual 108 um005001-zmp0400 rising edge of the clock prior to t3 at which time the dma operation (re)starts. figure 48 depicts the edge-sense dma timing. figure 48. cpu operation and dma operation dreq0 is programmed for edge-sense during the transfers for channel 0, the tend 0 output goes low synchronous with the write cycle of the last (bcr0 = ooh ) dma transfer (reference figure 49). figure 49. tend0 output timing diagram the dreq 0 and tend 0 pins are programmably multiplexed with the cka0 and cka1 asci clock input/outputs. however, when dma channel 0 is programmed for memory to/from i/o (and memory to/from tw t1 t2 t3 tw t1 t1 t1 t2 t2 t2 t3 t3 t3 dma cpu dma ** ** ** dreq0 is sampled at dreq0 phi ** ** t3 write cycle machine cycle read cycle dma write cycle cpu machine cycle tend0 phi last dma cycle (bcr0 = 00h) dma read cycle dma write cycle t1 t2 t3 tw t3 t2 t1
z8018x family mpu user manual um005001-zmp0400 109 memory mapped i/o. transfers, the cka0/ dreq 0 pin automatically functions as input pin or output pin even if it has been programmed as output pin for cka0. and the cka1/ tend 0 pin functions as an input or an output pin for tend 0 by setting cka1d to 1 in cntla1. to initiate memory to/from i/o (and memory to/from memory mapped i/o) dma transfer for channel 0, perform the following operations: 1. load the memory and i/o or memory mapped i/o source and destination addresses into sar0 and dar0. i/o addresses (not memory mapped i/o are limited to 16 bits (a0? a15). make sure that bits a16, a17 and a19 are 0 (a18 is a don't care) to correctly enable the external dreq 0 input. 2. specify memory to/from i/o or memory to/from memory mapped i/o mode and address increment/decrement in the sm0, sm1, dm0 and dm1 bits of dmode. 3. load the number of bytes to transfer in bcr0. 4. specify whether dreq 0 is edge- or level-sense by programming the dms0 bit of dcntl. 5. enable or disable dma termination interrupt with the die0 bit in dstat. 6. program de0: = 1 (with dweo = 0 in the same access) in dstat and the dma operation begins under the control of the dreq 0 input. memory to asci - channel 0 channel 0 has extra capability to support dma transfer to/from the on- chip two channel asci. in this case, the external dreq 0 input is not used for dma timing. rather, the asci status bits are used to generate an internal dreq 0 the tdre (transmit data register empty) bit and the rdrf (receive data register full) bit are used to generate an internal
z8018x family mpu user manual 110 um005001-zmp0400 dreq 0 for asci transmission and reception respectively. to initiate memory to/from asci dma transfer, perform the following operations: 1. load the source and destination addresses into sar0 and dar0 specify the i/o (asci) address as follows: a. bits a0?a7 must contain the address of the asci channel transmitter or receiver (i/o addresses 6h - 9h ). b. bits a8?a15 must equal 0. c. bits sar17?sar16 must be set according to table16 to enable use of the appropriate asci status bit as an internal dma request. table 16. dma transfer request sar18 sar17 sar16 dma transfer request x 0 0 dreq0 x 0 1 rdrf (asci channel 0) x 1 0 rdrf (asci channel 1) x 1 1 reserved note: x = don?t care dar18 dar17 dar16 dma transfer request x 0 0 dreq0 x 0 1 tdre (asci channel o) x 1 0 tdre (asci channel 1) x 1 1 reserved note: x = don?t care
z8018x family mpu user manual um005001-zmp0400 111 2. specify memory ? i/o transfer mode and address increment/ decrement in the sm0, sm1, dm0 and dm1 bits of dmode. 3. load the number of bytes to transfer in bcr0 4. the dma request sense mode (dms0 bit in dcntl) must be specified as edge sense . 5. enable or disable dma termination interrupt with the die0 bit in dstat. 6. program de0 = 1 (with dwe0 = 0 in the same access) in dstat and the dma operation with the asci begins under control of the asci generated internal dma request. the asci receiver or transmitter using dma is initialized to allow the first dma transfer to begin. the asci receiver must be empty as shown by rdrf = 0 . the asci transmitter must be full as shown by tdre = 0. thus, the first byte is written to the asci transmit data register under program control. the remaining bytes are transferred using dma. channel 1 dma dmac channel 1 performs memory to/from i/o transfers. except for different registers and status/control bits, operation is exactly the same as described for channel 0 memory to/from i/o dma. to initiate a dma channel 1 memory to/from i/o transfer, perform the following operations: 1. load the memory address (20 bits) into mar1. 2. load the i/o address (16 bits) into iar1. 3. program the source/destination and address increment/decrement mode using the dim1 and dim0 bits in dcntl.
z8018x family mpu user manual 112 um005001-zmp0400 4. specify whether dreq 1 is level- or edge- sense in the dms1 bit in dcntl. 5. enable or disable dma termination interrupt with the die1 bit in dstat. 6. program de1 = 1 (with dwe1 = 0 in the same access) in dstat and the dma operation with the external i/o device begins using the external dreq 1 input and tend1 output. dma bus timing when memory (and memory mapped i/o) is specified as a source or destination, mreq goes low during the memory access. when i/o is specified as a source or destination, iorq goes low during the i/o access. when i/o (and memory mapped i/o) is specified as a source or destination, the dma timing is controlled by the external dreq input and the tend output indicates dma termination external i/o devices may not overlap addresses with internal i/o and control registers, even using dma. for i/o accesses, one wait state is automatically inserted. additional wait states can be inserted by programming the on-chip wait state generator or using the external wait input. for memory mapped i/o accesses, this automatic i/o wait state is not inserted. for memory to memory transfers (channel 0 only), the external dreq0 input is ignored. automatic dma timing is programmed as either burst or cycle steal. when a dma memory address carry/borrow between bits a15 and a16 of the address bus occurs (crossing 64kb boundaries), the minimum bus note: note:
z8018x family mpu user manual um005001-zmp0400 113 cycle is extended to 4 clocks by automatic insertion of one internal ti state. dmac channel priority for simultaneous dreq 0 and dreq 1 requests, channel 0 has priority over channel 1. when channel 0 is performing a memory to/from memory transfer, channel 1 cannot operate until the channel 0 operation has terminated. if channel 1 is operating, channel 0 cannot operate until channel 1 releases control of the bus. dmac and busreq, busack the busreq and busack inputs allow another bus master to take control of the z8x180 bus. busreq and busack take priority over the on-chip dmac and suspends dmac operation. the dmac releases the bus to the external bus master at the breakpoint of the dmac memory or i/o access. since a single byte dmac transfer requires a read and a write cycle, it is possible for the dmac to be suspended after the dmac read, but before the dmac write. hence, when the external master releases the z8x180 bus ( busreq high), the on-chip dmac correctly continues the suspended dma operation.
z8018x family mpu user manual 114 um005001-zmp0400 dmac internal interrupts figure 50 illustrates the internal dma interrupt request generation circuit. figure 50. dma interrupt request generation de0 and de1 are automatically cleared to 0 by the z8x180 at the completion (byte count is 0 ) of a dma operation for channel 0 and channel 1, respectively. they remain 0 until a 1 is written. because de0: and de1 use level sense, an interrupt occurs if the cpu ief1 flag is set to 1 . therefore, the dma termination interrupt service routine disables further dma interrupts (by programming the channel die bit is 0 ) before enabling cpu interrupts (for example, ief1 is set to 1 ). after reloading the dmac address and count registers, the die bit can be set to 1 to reenable the channel interrupt, and at the same time dma can resume by programming the channel de bit = 1 . dmac and nmi nmi , unlike all other interrupts, automatically disables dmac operation by clearing the dme bit of dstat. thus, the nmi interrupt service routine responds to time-critical events without delay due to dmac bus usage. also, nmi can be effectively used as an external dma abort input, recognizing that both channels are suspended by the clearing of dme. de1 die1 de0 die0 ief1 dma ch1 interrupt request dma ch0 interrupt request
z8018x family mpu user manual um005001-zmp0400 115 if the falling edge of nmi occurs before the falling clock of the state prior to t3 (t2 or tw) of the dma write cycle, the dmac is suspended and the cpu starts the nmi response at the end of the current cycle. by setting a channel's de bit to 1 , the channel's operation is restarted and dma correctly resumes from its suspended point by nmi . (reference figure 51.) figure 51. nmi and dma operation timing diagram dmac and reset during reset the bits in dstat, dmode, and dcntl are initialized as stated in their individual register descriptions. any dma operation in progress is stopped, allowing the cpu to use the bus to perform the reset sequence. however, the address register (sar0, dar0 mar1, iar1) and byte count register (bcr0 bcr1) contents are not changed during reset. asynchronous serial communication interface (asci) the z8x180 on-chip asci has two independent full-duplex channels. based on full programmability of the following functions, the asci directly communicates with a wide variety of standard uarts (universal asynchronous receiver/transmitter) including the z8440 sio and the z85c30 scc. nmi phi dma write cycle t1 t2 t3 t3 t2 t1 dma read cycle nmi acknowledge cycle dme = ?0? (dma stop) t1
z8018x family mpu user manual 116 um005001-zmp0400 the key functions for asci on z80180, z8s180 and z8l180 class processors are listed below. each channel is independently programmable. ? full-duplex communication ? 7- or 8-bit data length ? program controlled 9th data bit for multiprocessor communication ? 1 or 2 stop bits ? odd, even, no parity ? parity, overrun, framing error detection ? programmable baud rate generator, /16 and /64 modes ? modem control signals ? channel 0 contains dcd0 , cts0 and rts0; channel 1 contains cts1 ? programmable interrupt condition enable and disable ? operation with on-chip dmac asci block diagram for the z8s180/z8l180-class processors figure 52 illustrates the asci block diagram.
z8018x family mpu user manual um005001-zmp0400 117 figure 52. asci block diagram asci register description the following subparagraphs explain the various functions of the asci registers. asci transmit shift register 0, 1 (tsr0, 1) when the asci transmit shift register receives data from the asci transmit data register (tdr), the data is shifted out to the txa pin. txa1 phi internal address/data bus interrupt request asci transmit data register ch 0 : tdr0 asci transmit shift register* ch 0 : tsr0 asci receive data register ch 0 : rdr0 asci receive shift register* ch 0 : rsr0 (8) asci control register a ch 0 : cntla0 (8) asci control register b ch 0 : cntlb0 (8) asci status register ch 0 : stat0 (8) cka1 * not program accessible baud rate generator 0 baud rate generator 1 asci status register ch 1 : stat1 (8) asci control register b ch 1 : cntlb1 (8) asci control register a ch 1 : cntla1 (8) asci transmit data register ch 1 : tdr1 asci transmit shift register* ch 1 : tsr1 asci receive data register ch 1 : rdr1 asci receive shift register* ch 1 : rsr1 (8) asci control rxa1 cka0 cts1 rts0 cts0 dcd0 txa0 rxa0
z8018x family mpu user manual 118 um005001-zmp0400 when transmission is completed, the next byte (if available) is automatically loaded from tdr into tsr and the next transmission starts. if no data is available for transmission, tsr idles by outputting a continuous high level. the tsr is not program-accessible. asci transmit data register 0, 1(tdr0,1:i/o address = 06h, 07h) data written to the asci transmit data register is transferred to the tsr as soon as tsr is empty. data can be written while tsr is shifting out the previous byte of data. thus, the asci transmitter is double buffered. data can be written into and read from the asci transmit data register. if data is read from the asci transmit data register, the asci data transmit operation is not affected by this read operation. asci transmit data register ch. 0 (tdr0: 06h) bit 7 6 5 4 3 2 1 0 bit/field asci transmit channel 0 r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable asci transmit data register ch. 1 (tdr1: 07h) bit 7 6 5 4 3 2 1 0 bit/field asci transmit channel 1 r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable
z8018x family mpu user manual um005001-zmp0400 119 asci receive shift register 0,1(rsr0, 1) this register receives data shifted in on the rxa pin. when full, data is automatically transferred to the asci receive data register (rdr) if it is empty. if rsr is not empty when the next incoming data byte is shifted in, an overrun error occurs. the rsr is not program-accessible. asci receive data register 0,1 (rdr0, 1: i/o address = 08h , 09h ) when a complete incoming data byte is assembled in rsr, it is automatically transferred to the rdr if rdr is empty. the next incoming data byte can be shifted into rsr while rdr contains the previous received data byte. thus, the asci receiver on z80180 is double- buffered. \ on the z8s180 and z8l180-class processors are quadruple buffered. the asci receive data register is a read-only register. however, if rdrf = asci receive data register ch. 0 (rdr0: 08h) bit 7 6 5 4 3 2 1 0 bit/field asci receive channel 0 r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable asci receive data register ch. 1 (rdr1: 09h) bit 7 6 5 4 3 2 1 0 bit/field asci receive channel 1 r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable
z8018x family mpu user manual 120 um005001-zmp0400 0 , data can be written into the ascii receive data register, and the data can be read. asci status register 0, 1 (stat0, 1) each channel status register allows interrogation of asci communication, error and modem control signal status, and enabling or disabling of asci interrupts. asci status register 0 (stat0: 04h) bit 7 6 5 4 3 2 1 0 bit/field rdrf ovrn pe fe rie dcd0 tdre tie r/w r r r r r/w r r r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 rdrf r receive data register full ? rdrf is set to 1 when an incoming data byte is loaded into rdr. if a framing or parity error occurs, rdrf remains set and the receive data (which generated the error) is still loaded into rdr. rdrf is cleared to 0 by reading rdr, when the dcd0 input is high, in iostop mode, and during reset. 6 ovrn r overrun error ? ovrn is set to 1 when rdr is full and rsr becomes full. ovrn is cleared to 0 when the efr bit (error flag reset) of cntla is written to 0, when dcd0 is high, in iostop mode, and during reset.
z8018x family mpu user manual um005001-zmp0400 121 5 pe r parity error ? pe is set to 1 when a parity error is detected on an incoming data byte and asci parity detection is enabled (the mod1 bit of cntla is set to 1). pe is cleared to 0 when the efr bit (error flag reset) of cntla is written to 0, when dcd0 is high, in iostop mode, and during reset. 4 fe r framing error ? if a receive data byte frame is delimited by an invalid stop bit (that is, 0, should be 1), fe is set to 1. fe is cleared to 0 when the efr bit (error flag reset) of cntla is written to 0, when dcd0 is high, in iostop mode, and during reset. 3 rie r/w receive interrupt enable ? rie must be set to 1 to enable asci receive interrupt requests. when rie is 1, if any of the flags rdrf, ovrn, pe, or fe become set to 1, an interrupt request is generated. for channel 0, an interrupt is also generated by the transition of the external dcd0 input from low to high. 2 dcd0 r data carrier detect ? channel 0 has an external dcd0 input pin. the dcd0 bit is set to 1 when the dcd 0 input is high. it is cleared to 0 on the first read of (stat0, following the dcd0 input transition from high to low and during reset. when dcd0 is 1, receiver unit is reset and receiver operation is inhibited. 1 tdre r transmit data register empty ? tdre = 1 indicates that the tdr is empty and the next transmit data byte is written to tdr. after the byte is written to tdr, tdre is cleared to 0 until the asci transfers the byte from tdr to the tsr and then tdre is again set to 1. tdre is set to 1 in iostop mode and during reset. when the external cts input is high, tdre is reset to 0. bit position bit/field r/w value description
z8018x family mpu user manual 122 um005001-zmp0400 0 tie r/w transmit interrupt enable ? tie must be set to 1 to enable asci transmit interrupt requests. if tie is 1, an interrupt is requested when tdre is 1. tie is cleared to 0 during reset. bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 123 asci control register a0, 1 (cntla0, 1) each asci channel control register a configures the major operating modes such as receiver/transmitter enable and disable, data format, and multiprocessor communication mode. asci status register 1 (stat1: 05h) bit 7 6 5 4 3 2 1 0 bit/field rdrf ovrn pe fe rie cts1e tdre tie r/w r r r r r/w r/w r r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 rdrf r receive data register full ? rdrf is set to 1 when an incoming data byte is loaded into rdr. note that if a framing or parity error occurs, rdrf is still set and the receive data (which generated the error) is still loaded into rdr. rdrf is cleared to 0 by reading rdr, when the dcd0 input is high, in iostop mode, and during reset. 6 ovrn r overrun error ? ovrn is set to 1 when rdr is full and rsr becomes full. ovrn is cleared to 0 when the efr bit (error flag reset) of cntla is written to 0, when dcd0 is high, in iostop mode, and during reset. 5 pe r parity error ? pe is set to 1 when a parity error is detected on an incoming data byte and asci parity detection is enabled (the mod1 bit of cntla is set to 1). pe is cleared to 0 when the efr bit (error flag reset) of cntla is written to 0, when dcd0 is high, in iostop mode, and during reset.
z8018x family mpu user manual 124 um005001-zmp0400 4 fe r framing error ? if a receive data byte frame is delimited by an invalid stop bit (that is, 0, should be 1), fe is set to 1. fe is cleared to 0 when the efr bit (error flag reset) of cntla is written to 0, when dcd0 is high, in iostop mode, and during reset. 3 rie r/w receive interrupt enable ? rie must be set to 1 to enable asci receive interrupt requests. when rie is 1, if any of the flags rdrf, ovrn, pe, or fe become set to 1, an interrupt request is generated. for channel 0, an interrupt is also generated by the transition of the external dcd0 input from low to high. 2 cts1e r/w channel 1 cts enable ? channel 1 has an external cts1 input which is multiplexed with the receive data pin (rxs) for the csi/o (clocked serial i/o port). setting cts1e to 1 selects the cts1 function and clearing cts1e to 0 selects the rxs function. 1 tdre r transmit data register empty ? tdre = 1 indicates that the tdr is empty and the next transmit data byte is written to tdr. after the byte is written to tdr, tdre is cleared to 0 until the asci transfers the byte from tdr to the tsr and then tdre is again set to 1. tdre is set to 1 in iostop mode and during reset. when the external cts input is high, tdre is reset to 0. 0 tie r/w transmit interrupt enable ? tie must be set to 1 to enable asci transmit interrupt requests. if tie is 1, an interrupt is requested when tdre is 1. tie is cleared to 0 during reset. bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 125 asci control register a0, 1 (cntla0, 1) each asci channel control register a configures the major operating modes such as receiver/transmitter enable and disable, data format, and multiprocessor communication mode. asci control register a 0 (cntla0: 00h) bit 7 6 5 4 3 2 1 0 bit/field mpe re te rts0 mpbr/ efr mod2 mod1 mod0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 1 x 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 mpe r/w multi-processor mode enable ? the asci has a multiprocessor communication mode which utilizes an extra data bit for selective communication when a number of processors share a common serial bus. multiprocessor data format is selected when the mp bit in cntlb is set to 1. if multiprocessor mode is not selected (mp bit in cntlb = 0), mpe has no effect. if multiprocessor mode is selected, mpe enables or disables the wakeup feature as follows. if mpe is set to 1, only received bytes in which the mpb (multiprocessor bit) is 1 can affect the rdrf and error flags. effectively, other bytes (with mpb is 0) are ignored by the asci. if mpe is reset to 0, all bytes, regardless of the state of the mpb data bit, affect the rdrf and error flags.
z8018x family mpu user manual 126 um005001-zmp0400 6 re r/w receiver enable ? when re is set to 1, the asci receiver is enabled. when re is reset to 0, the receiver is disabled and any receive operation in progress is interrupted. however, the rdrf and error flags are not reset and the previous contents of rdrf and error flags are held. re is cleared to 0 in iostop mode, and during reset. 5 te r/w transmitter enable ? when te is set to 1, the asci transmitter is enabled. when te is reset to 0, the transmitter is disabled and any transmit operation in progress is interrupted. however, the tdre flag is not reset and the previous contents of tdre are held. te is cleared to 0 in iostop mode, and during reset. 4 rts0 r/w request to send channel 0 ? when rts0 is reset to 0, the rts0 output pin goes low. when rts0 is set to 1, the rts0 output immediately goes high. 3 mpbr/ efr r/w multiprocessor bit receive/error flag reset ? when multiprocessor mode is enabled (mp in cntlb is 1), mpbr, when read, contains the value of the mpb bit for the last receive operation. when written to 0, the efr function is selected to reset all error flags (ovrn, fe and pe) to 0. mpbr/efr is undefined during reset. bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 127 2 ? 0 mod2 ? 0 r/w asci data format mode 2, 1, 0 ? these bits program the asci data format as follows. mod2 0: 7 bit data 1: 8 bit data mod1 0: no parity 1: parity enabled mod0 0: 1 stop bit 1: 2 stop bits the data formats available based on all combinations of mod2, mod1 and mod0 are described in table17. bit position bit/field r/w value description
z8018x family mpu user manual 128 um005001-zmp0400 asci control register a 1 (cntla1: 01h) bit 7 6 5 4 3 2 1 0 bit/field mpe re te cka1d mpbr/ efr mod2 mod1 mod0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 x 0 0 0 r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 mpe r/w multi-processor mode enable ? the asci has a multiprocessor communication mode which utilizes an extra data bit for selective communication when a number of processors share a common serial bus. multiprocessor data format is selected when the mp bit in cntlb is set to 1. if multiprocessor mode is not selected (mp bit in cntlb = 0), mpe has no effect. if multiprocessor mode is selected, mpe enables or disables the wakeup feature as follows. if mpe is set to 1, only received bytes in which the mpb (multiprocessor bit) is 1 can affect the rdrf and error flags. effectively, other bytes (with mpb = 0) are ignored by the asci. if mpe is reset to 0, all bytes, regardless of the state of the mpb data bit, affect the rdrf and error flags. 6 re r/w receiver enable ? when re is set to 1, the asci receiver is enabled. when re is reset to 0, the receiver is disabled and any receive operation in progress is interrupted. however, the rdrf and error flags are not reset and the previous contents of rdrf and error flags are held. re is cleared to 0 in iostop mode, and during reset.
z8018x family mpu user manual um005001-zmp0400 129 5 te r/w transmitter enable ? when te is set to 1, the asci transmitter is enabled. when te is reset to 0, the transmitter is disabled and any transmit operation in progress is interrupted. however, the tdre flag is not reset and the previous contents of tdre are held. te is cleared to 0 in iostop mode, and during reset. 4 cka1d r/w cka1 clock disable ? when cka1d is set to 1, the multiplexed cka1/ tend0 pin is used for the tend0 function. when cka1 d is 0, the pin is used as cka1, an external data dock input/output for channel 1 3 mpbr/ efr r/w multiprocessor bit receive/error flag reset ? when multiprocessor mode is enabled (mp in cntlb is 1), mpbr, when read, contains the value of the mpb bit for the last receive operation. when written to 0, the efr function is selected to reset all error flags (ovrn, fe and pe) to 0. mpbr/efr is undefined during reset. bit position bit/field r/w value description
z8018x family mpu user manual 130 um005001-zmp0400 2 ? 0 mod2 ? 0 r/w asci data format mode 2, 1, 0 ? these bits program the asci data format as follows. mod2 0: 7 bit data 1: 8 bit data mod1 0: no parity 1: parity enabled mod0 0: 1 stop bit 1: 2 stop bits the data formats available based on all combinations of mod2, mod1 and mod0 are described in table17. bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 131 asci control register b0, 1 (cntlb0, 1) each asci channel control register b configures multiprocessor mode, parity and baud rate selection. table 17. data formats mod2 mod1 mod0 data format 0 0 0 start + 7 bit data + 1 stop 0 0 1 start + 7 bit date + 2 stop 0 1 0 start + 7 bit data + parity + 1 stop 0 1 1 start + 7 bit data + parity + 2 stop 1 0 0 start + 8 bit data + 1 stop 1 0 1 start + 8 bit data + 2 stop 1 1 0 start + 8 bit data + parity + 1 stop 1 1 1 start + 8 bit date + parity + 2 stop
z8018x family mpu user manual 132 um005001-zmp0400 asci control register b 0 (cntlb0: 02h) asci control register b 1 (cntlb1: 03h) bit 7 6 5 4 3 2 1 0 bit/field mpbt mp cts /ps pe0 dr ss2 ss1 ss0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset x 0 0 0 0 1 1 1 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 mpbt r/w multiprocessor bit transmit ? when multiprocessor communication format is selected (mp bit is 1), mpbt is used to specify the mpb data bit for transmission. if mpbt is 1, then mpb = 1 is transmitted. if mpbt is 0, then mpbt = 0 is transmitted. mpbt state is undefined during and after reset. 6 mp r/w multiprocessor mode ? when mp is set to 1, the data format is configured for multiprocessor mode based on the mod2 (number of data bits) and mod0 (number of stop bits) bits in cntla. the format is as follows. start bit + 7 or 8 data bits + mpb bit + 1 or 2 stop bits multiprocessor (mp = 1) format has no provision for parity. if mp is 0, the data format is based on mod0 mod1, mod2, and may include parity. the mp bit is cleared to 0 during reset.
z8018x family mpu user manual um005001-zmp0400 133 the external asci channel 0 data clock pins are multiplexed with dma control lines (cka0/ dreq and cka1/ tend 0 ). during reset, these 5 cts /ps r/w clear to send/prescale ? when read, cts /ps reflects the state of the external cts input. if the cts input pin is high, cts /ps is read as 1. when the cts input pin is high, the tdre bit is inhibited (that is, held at 0). for channel 1, the cts 1 input is multiplexed with rxs pin (clocked serial receive data). thus, cts /ps is only valid when read if the channel 1 cts1e bit is 1 and the cst1 input pin function is selected. the read data of cts /ps is not affected by reset. when written, ct /ps specifies the baud rate generator prescale factor. if cts /ps is set to 1, the system clock is prescaled by 30 while if cts /ps is cleared to 0, the system clock is prescaled by 10.cts/ps is cleared to 0 during reset. 4 peo r/w parity even odd ? pe0 selects even or odd parity. pe0 does not affect the enabling/disabling of parity (mod1 bit of cntla). if pe0 is cleared to 0, even parity is selected. if pe0 is set to 1, odd parity is selected.pe0 is cleared to 0 during reset. 3 dr r/w divide ratio ? dr specifies the divider used to obtain baud rate from the data sampling clock if dr is reset to 0, divide by 16 is used, while if dr is set to 1, divide by 64 is used. dr is cleared to 0 during reset. 2 ? 0 ss2 ? 0 r/w source/speed select ? specifies the data clock source (internal or external) and baud rate prescale factor. ss2, ss1, and ss0 are all set to 1 during reset. table18 describes the divide ratio corresponding to ss2, ss1 and ss0 bit position bit/field r/w value description
z8018x family mpu user manual 134 um005001-zmp0400 pins are initialized as asci data clock inputs. if ss2, ss1 and ss0 are reprogrammed (any other value than ss2, ss1, ss0 = 1 ) these pins become asci data clock inputs. however, if dmac channel 0 is configured to perform memory to/from i/o (and memory mapped i/o) transfers the cka0/ dreq 0 pin reverts to dma control signals regardless of ss2, ss1, ss0 programming. also, if the cka1d bit in the cntla register is 1 , then the cka1/ tend 0 reverts to the dma control output function regardless of ss2, ss1 and ss0 programming. final data clock rates are based on cts /ps (prescale), dr, ss2, ss1, ss0 and the z8x180 system clock frequency (reference table19). each asci channel control register b configures multiprocessor mode, parity and baud rate selection. table 18. divide ratio ss2 ss1 ss0 divide ratio 0 0 0 ? 1 0 0 1 ? 2 0 1 0 ? 4 0 1 1 ? 8 1 0 0 ? 16 1 0 1 ? 32 1 1 0 ? 64 1 1 1 external clock
z8018x family mpu user manual um005001-zmp0400 135 asci0 extension control register (i/o address: 12h) (z8s180/l180-class processors only) bit 7 6 5 4 3 2 1 0 bit/field rdrf int inhibit dcd0 disable cts0 disable x1 bit clk asci0 brg0 mode break feature enable break detect (ro) send break r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 rdrf interrupt inhibit r/w 0 1 rdrf interrupt inhibit on rdrf interrupt inhibit off 6 dcd0 disable r/w 0 1 dcd0 auto-enables rx dcd0 advisory to sw 5 cts0 disable r/w 0 1 cts0 auto-enable tx cts0 advisory to sw 4 x1 bit clk asci0 r/w 0 1 cka0 /16 or /64 cka0 is bit clock 3 brg0 mode r/w 0 1 as s180 enable 16-bit brg counter 2 break feature enable r/w 0 1 break feature enable on break feature enable off 1 break detect (ro) r/w 0 1 break detect on break detect off
z8018x family mpu user manual 136 um005001-zmp0400 each asci channel control register b configures multiprocessor mode, parity and baud rate selection. 0 send break r/w 0 1 normal xmit drive txa low asci1 extension control register (i/o address: 13h) (z8s180/l180-class processors only) bit 7 6 5 4 3 2 1 0 bit/field rdrf int inhibit reserved x1 bit clk asci1 brg1 mode break feature enable break detect (ro) send break r/w r/w ? r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 rdrf interrupt inhibit r/w 0 1 rdrf interrupt inhibit on rdrf interrupt inhibit off 6?5 reserved ? 0 reserved. must be 0 4 x1 bit clk asci1 r/w 0 1 cka1 /16 or /64 cka1 is bit clock 3 brg1 mode r/w 0 1 as s180 enable 16-bit brg counter bit position bit/field r/w value description
z8018x family mpu user manual um005001-zmp0400 137 each asci channel control register b configures multiprocessor mode, parity and baud rate selection. 2 break feature enable r/w 0 1 break feature enable on break feature enable off 1 break detect (ro) r/w 0 1 break detect on break detect off 0 send break r/w 0 1 normal xmit drive txa low asci0 time constant low register (i/o address: 1ah) (z8s180/l180-class processors only) bit 7 6 5 4 3 2 1 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable asci0 time constant high register (i/o address: 1bh) (z8s180/l180-class processors only) bit 7 6 5 4 3 2 1 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description
z8018x family mpu user manual 138 um005001-zmp0400 modem control signals asci channel 0 has cts0 , dcd0 and rts0 external modem control signals. asci channel 1 has a cts1 modem control signal which is multiplexed with clocked serial receive data (rxs). cts0 : clear to send 0 (input) the cts0 input allows external control (start/stop) of asci channel 0 transmit operations. when cts0 is high, the channel 0 tdre bit is held at 0 whether or not the tdr0 (transmit data register) is full or empty. when cts0 is low, tdre reflects the state of tdr0. the actual transmit operation is not disabled by ct high, only tdre is inhibited: dcd0 : data carrier detect 0 (input) the dcd 0 input allows external control (start/stop) of asci channel 0 receive operations. when dcd0 is high, the channel 0 rdrf bit is held at 0 whether or not the rdr0, (receive data register) is full or empty. asci1 time constant low register (i/o address: 1ch) (z8s180/l180-class processors only) bit 7 6 5 4 3 2 1 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable asci1 time constant high register (i/o address: 1dh) (z8s180/l180-class processors only) bit 7 6 5 4 3 2 1 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable
z8018x family mpu user manual um005001-zmp0400 139 the error flags (pe, fe, and ovrn bits) are also held at 0 . even after the dcd0 input goes low, these bits do not resume normal operation until the status register (stat0, is read. this first read of (stat0, while enabling normal operation, still indicates the dcd 0 input is high ( dcd0 bit = 1) even though it has gone low. thus, the stat0 register must be read twice to ensure the dcd 0 bit is reset to 0 : rts0 : request to send 0 (output) rts0 allows the asci to control (start/stop) another communication devices transmission (for example, by connection to that device's cts input). rts0 is essentially a 1-bit output port, having no side effects on other asci registers or flags. cts1 : clear to send 1 (input) channel 1 cts1 input is multiplexed with clocked serial receive data (rxs). the cts1 function is selected when the cts1 e bit in stat1 is set to 1 . when enabled, the cts1 operation is equivalent to cts0, modem control signal timing is depicted in figure 53 and figure 54. figure 53. dcd0 timing diagram dcd0 pin dcd0 flag status register read
z8018x family mpu user manual 140 um005001-zmp0400 figure 54. rts0 timing diagram figure 55 illustrates the asci interrupt request generation circuit. figure 55. asci interrupt request circuit diagram t1 t1 t2 t3 wr rts0 flag rts0 pin phi i/o instruction i/o write cycle ief1 asci0 interrupt request asci1 interrupt request tie1 tdre1 rie1 rdrf1 ovrn1 pe1 fe1 tie0 tdre0 rie0 dcd0 ovrn0 pe0 fe0 rdrf0
z8018x family mpu user manual um005001-zmp0400 141 asci to/from dmac operation operation of the asci with the on-chip dmac channel 0 requires that the dmac be correctly configured to use the asci flags as dma request signals. asci and reset during reset, the asci status and control registers are initialized as defined in the individual register descriptions. receive and transmit operations are stopped during reset. however, the contents of the transmit and receive data registers (tdr and rdr) are not changed by reset. asci clock when in external clock input mode, the external clock is directly input to the sampling rate ( ? 16/ ? 64) as depicted in figure 56. figure 56. asci clock external clock fc phi ? 40 internal clock phi baud rate selection prescaler sampling rate ? 1 to ? 64 ? 10 ? 30 ? 16 ? 64
z8018x family mpu user manual 142 um005001-zmp0400 table 19. asci baud rate selection prescaler sampling rate baud rate general divide ratio baud rate (example) (bps) cka ps divide ratio dr rate ss2 ss1 ss0 divide ratio f = 6.144 mhz f = 4.608 mhz f = 3.072 mhz i/o clock frequency 0 f ? 10 0 16 0 0 0 ? 1 f ? 160 38400 19200 f ? 10 0 0 1 2 320 19200 9600 20 0 1 0 4 640 9600 4800 40 0 1 1 8 1280 4800 2400 0 80 1 0 0 16 2560 2400 1200 160 1 0 1 32 5120 1200 600 320 1 1 0 64 10240 600 300 640 1 1 1 ? fc ? 16 ? ? ? i fc 1 64 0 0 0 ? 1 0 ? 640 9600 4800 f ? 10 0 0 1 2 1280 4800 2400 20 0 1 0 4 2560 2400 1200 40 0 1 1 8 5120 1200 600 0 80 1 0 0 16 10240 600 300 160 1 0 1 32 20480 300 150 320 1 1 0 64 40960 150 75 640 1 1 1 ? fc ? 64 ? ? ? i fc
z8018x family mpu user manual um005001-zmp0400 143 baud rate generator (z8s180/z8l180-class processors only) the z8s180/z8l180 baud rate generator (brg) features two modes. the first is the same as in the z80180. the second is a 16-bit down counter that divides the processor clock by the value in a 16-bit time constant register, and is identical to the dmscc brg. this feature 1 f ? 30 0 16 0 0 0 ? 1 f ? 480 9600 f ? 30 0 0 1 2 960 4800 60 0 1 0 4 1920 2400 120 0 1 1 8 3840 1200 0 240 1 0 0 16 7680 600 480 1 0 1 32 15360 300 960 1 1 0 64 30720 150 1920 1 1 1 ? fc ? 16 ? ? ? i fc 1 64 0 0 0 ? 1 f ? 1920 2400 f ? 30 0 0 1 2 3840 1200 60 0 1 0 4 7680 600 120 0 1 1 8 15360 300 0 240 1 0 0 16 30720 150 480 1 0 1 32 61440 75 960 1 1 0 64 122880 37.5 1920 1 1 1 ? fc ? 64 ? ? ? i fc table 19. asci baud rate selection (continued) prescaler sampling rate baud rate general divide ratio baud rate (example) (bps) cka ps divide ratio dr rate ss2 ss1 ss0 divide ratio f = 6.144 mhz f = 4.608 mhz f = 3.072 mhz i/o clock frequency
z8018x family mpu user manual 144 um005001-zmp0400 allows a common baud rate of up to 512 kbps to be selected. the brg can also be disabled in favor of an external clock on the cka pin. the receiver and transmitter subsequently divide the output of the brg (or the signal from the cka pin) by 1, 16, or 64, under the control of the dr bit in the cntlb register, and the x1 bit in the asci extension control register. to compute baud rate, use the following formulas: where: brg mode is bit 3 of the asext register ps is bit 5 of the cntlb register tc is the 16-bit value in the asci time constant register if ss2.1.0 = 111, baud rate - f cka /clock mode else if brg mode baud rate = f phi /(2*(tc+2)*clock mode) else baud rate -f phi /((10 + 20*ps) * 2^ss*clock mode) the tc value for a given baud rate is: tc = (f phi /*2*baud rate*clock mode)) -2 clock mode depends on bit 4 in asext and bit 3 in cntlb, as described in table20. table 20. clock mode bit values x1 dr clock mode 0 0 1 1 0 1 0 1 16 64 1 reserved, do not use
z8018x family mpu user manual um005001-zmp0400 145 2^ss depends on the three least significant bits of the cntlb register, as described in table21. the ascis require a 50% duty cycle when cka is used as an input. minimum high and low times on cka0 are typical of most cmos devices. rdrf is set, and if enabled, an rx interrupt or dma request is generated when the receiver transfers a character from the rx shift register to the rx fifo. the fifo provides a margin against overruns. when the is more than one character in the fifo, and software or a dma channel reads a character, rdrf either remains set or is cleared and then immediately set again. for example, if a receive interrupt service routine does not real all the characters in the rxfifo, rdrf and the interrupt request remain asserted. the rx dma request is disabled when any of the error flags pe or fe or ovrn are set, so that software can identify with which character the problem is associated. if bit 7, rdrf interrupt inhibit, is set to 1, the asci does not request a receive interrupt when its rdrf flag is 1. set this bit when programming a dma channel to handle the receive data from an asci. the other table 21. 2^ss values ss2 ss1 ss0 2^ss 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 1 2 4 8 16 32 64 external clock from cka0
z8018x family mpu user manual 146 um005001-zmp0400 causes for an asci receive interrupt (pe, fe, ovrn, and for asci0, dcd) continue to request rx interrupt if the rie bit is 1. the rx dma request is inhibited if pe or fe or ovrn is set, so that software can detect where an error occurred. when the rie bit is 0, as it is after a reset, rdrf causes an asci interrupt if rie is 1. clocked serial i/o port (csi/o) the z8x180 includes a simple, high-speed clock, synchronous serial i/o port. the csi/o includes transmit/receive (half-duplex), fixed 8-bit data, and internal or external data clock selection. high-speed operation (baud rate 200kbps at fc = 4 mhz) is provided. the csi/o is ideal for implementing a multiprocessor communication link between multiple z8x180s. these secondary devices may typically perform a portion of the system i/o processing, (that is, keyboard scan/decode, ldc interface, for instance). csi/o block diagram the csi/o block diagram is illustrated in figure 57. the csi/o consists of two registers?the transmit/receive data register (trdr) and control register (cntr).
z8018x family mpu user manual um005001-zmp0400 147 figure 57. csi/o block diagram csi/o registers description csi/o control/status register (cntr: i/o address 0ah) cntr is used to monitor csi/o status, enable and disable the csi/o, enable and disable interrupt generation, and select the data clock speed and source. csi/o control/status register (cntr: 0ah) bit 7 6 5 4 3 2 1 0 bit/field ef eie re te ? ss2 ss1 ss0 r/w r r/w r/w r/w r/w r/w r/w reset 0 0 0 0 1 1 1 note: r = read w = write x = indeterminate ? = not applicable phi internal address/data bus txs rxs interrupt request baud rate generator cks csi/o transmit/receive data register: trdr (8) csi/o control register: cntr (8)
z8018x family mpu user manual 148 um005001-zmp0400 bit position bit/field r/w value description 7 ef r end flag ? ef is set to 1 by the csi/o to indicate completion of an 8-bit data transmit or receive operation. if eie (end interrupt enable) bit = 1 when ef is set to 1, a cpu interrupt request is generated. program access of trdr only occurs if ef is 1. the csi/o clears ef to 0 when trdr is read or written. ef is cleared to 0 during reset and iostop mode. 6 eie r/w end interrupt enable ? eie is set to 1 to enable ef = 1 to generate a cpu interrupt request. the interrupt request is inhibited if eie is reset to 0. eie is cleared to 0 during reset. 5 re r/w receive enable ? a csi/o receive operation is started by setting re to 1. when re is set to 1, the data clock is enabled. in internal clock mode, the data clock is output from the cks pin. in external dock mode, the dock is input on the cks pin. in either case, data is shifted in on the rxs pin in synchronization with the (internal or external) data clock. after receiving 8 bits of data, the csi/o automatically clears re to 0, ef is set to 1, and an interrupt (if enabled by eie = 1) is generated. re and te are never both set to 1 at the same time. re is cleared to 0 during reset and istop mode. rxs is multiplexed with cts1 modem control input of asci channel 1. in order to enable the rxs function, the cts1e bit in cnta1 must be reset to 0.
z8018x family mpu user manual um005001-zmp0400 149 csi/o transmit/receive data register (trdr: i/o address = 0bh). trdr is used for both csi/o transmission and reception. thus, the system design must insure that the constraints of half-duplex operation are met (transmit and receive operation cannot occur simultaneously). for example, if a csi/o transmission is attempted while the csi/o is receiving data, the csi/o does not work. trdr is not buffered. attempting to perform a csi/o transmit while the previous transmit data is still being shifted out causes the shift data to be immediately updated, thereby corrupting the transmit operation in progress. similarly, reading trdr during a transmit or receive must be avoided. 4 te r/w transmit enable ? a csi/o transmit operation is started by setting te to 1. when te is set to 1, the data clock is enabled. when in internal clock mode, the data clock is output from the cks pin. in external clock mode, the clock is input on the cks pin. in either case, data is shifted out on the txs pin synchronous with the (internal or external) data clock. after transmitting 8 bits of data, the csi/o automatically clears te to 0, ef is set to 1, and an interrupt (if enabled by eie = 1) is generated. te and re are never both set to 1 at the same time. te is cleared to 0 during reset and iostop mode. 2 ? 0 ss2 ? 0 r/w speed select ? selects the csi/o transmit/receive clock source and speed. ss2, ss i and ss0 are all set to 1 during reset. table22 shows csi/o baud rate selection. bit position bit/field r/w value description
z8018x family mpu user manual 150 um005001-zmp0400 after reset, the cks pin is configured as an external clock input (ss2, ss1, ss0 = 1). changing these values causes cks to become an output pin and the selected clock is output when transmit or receive operations are enabled. csi/o interrupts the csi/o interrupt request circuit is shown in figure 58. csi/o transmit/receive register (trdr: 0bh) bit 7 6 5 4 3 2 1 0 bit/field csi/o transmit/receive data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable table 22. csi/o baud rate selection ss2 ss1 ss0 divide ratio baud rate 0 0 0 ? 20 (200000) 0 0 1 ? 40 (100000) 0 1 0 ? 80 (50000) 0 1 1 ? 160 (25000) 1 0 0 ? 320 (12500) 1 0 1 ? 640 (6250) 1 1 0 ? 1280 (3125) 1 1 1 external clock input (less than ? 20) note: () indicates the baud rate (bps) at phi = 4 mhz.
z8018x family mpu user manual um005001-zmp0400 151 figure 58. csi/o interrupt request generation csi/o operation the csi/o is operated using status polling or interrupt driven algorithms. ? transmit?polling a. poll the te bit in cntr until te = 0 . b. write the transmit data into trdr. c. set the te bit in cntr to 1 . d. repeat steps 1 to 3 for each transmit data byte. ? transmit?interrupts a. poll the te bit in cntr until te = 0 . b. write the first transmit data byte into trdr. c. set the te and eie bits in cntr to 1 . d. when the transmit interrupt occurs, write the next transmit data byte into trdr. e. set the te bit in cntr to 1 . f. repeat steps 4 and 5 for each transmit data byte. ? receive ?polling a. poll the re bit in cntr until re = 0 . b. set the re bit in cntr to 1 . ef eie ief1 csi/o interrupt request
z8018x family mpu user manual 152 um005001-zmp0400 c. poll the re bit in cntr until re = 0 . d. read the receive data from trdr. e. repeat steps 2 to 4 for each receive data byte. ? receive?interrupts a. poll the re bit in cntr until re is 0 . b. set the re and eie bits in cntr to 1 . c. when the receive interrupt occurs read the receive data from trdr. d. set the re bit in cntr to 1 . e. repeat steps 3 and 4 for each receive data byte. csi/o operation timing notes ? transmitter clocking and receiver sampling timings are different from internal and external clocking modes. figure 59 to figure 62 illustrate csi/o transmit/receive timing. ? the transmitter and receiver is disabled te and re = 0 ) when initializing or changing the baud rate. csi/o operation notes ? disable the transmitter and receiver (te and re = 0 ) before initializing or changing the baud rate. when changing the baud rate after completion of transmission or reception, a delay of at least one bit time is required before baud rate modification. ? when re or te is cleared to 0 by software, a corresponding receive or transmit operation is immediately terminated. normally, te or re is only cleared to 0 when ef is 1 . ? simultaneous transmission and reception is not possible. thus, te and re are not both 1 at the same time.
z8018x family mpu user manual um005001-zmp0400 153 csi/o and reset during reset each bit in the cntr is initialized as defined in the cntr register description. csi/o transmit and receive operations in progress are aborted during reset. however, the contents of trdr are not changed. figure 59. transmit timing diagram ?internal clock cks txs te ef lsb msb read or write of csi/o transmit/receive data register
z8018x family mpu user manual 154 um005001-zmp0400 figure 60. transmit timing?external clock cks txs te ef read or write of csi/o transmit/receive data register 2.5 f 2.5 f 2.5 f 2.5 f 7.5 f 7.5 f 7.5 f 7.5 f lsb msb
z8018x family mpu user manual um005001-zmp0400 155 figure 61. csi/o receive timing?internal clock cks rxs re ef read or write of csi/o transmit/receive data register 11 f 11 f 11 f 11 f sampling 17 f lsb msb
z8018x family mpu user manual 156 um005001-zmp0400 figure 62. csi/o receive timing?external clock programmable reload timer (prt) the z8x180 contains a two channel 16-bit programmable reload timer. each prt channel contains a 16-bit down counter and a 16-bit reload register. the down counter is directly read and written and a down counter overflow interrupt can be programmably enabled or disabled. also, prt channel 1 features a tout output pin (multiplexed with a18) which can be set high, low, or toggled. thus, prt1 can perform programmable output waveform generation. prt block diagram the prt block diagram is depicted in figure 63. the two channels feature separate timer data and reload registers and a common status/ cks rxs re ef read or write of csi/o transmit/receive data register 11.5 f sampling lsb msb 11.5 f 11.5 f 11.5 f 16.5 f 16.5 f 16.5 f 16.5 f
z8018x family mpu user manual um005001-zmp0400 157 control register. the prt input clock for both channels is equal to the system clock divided by 20. figure 63. prt block diagram prt register description timer data register (tmdr: i/o address - ch0: 0ch, 0dh; ch1: 15h, 14h). prt0 and prt1 each contain 16-bit timer data registers (tmdr). tmdr0 and tmdr1 are each accessed as low and high byte registers (tmdr0h, tmdr0l and tmdr1h, tmdr1l). during reset, tmdr0 and tmdr1 are set to ffffh . tmdr is decremented once every twenty clocks. when tmdr counts down to 0, it is automatically reloaded with the value contained in the reload register (rldr). tmdr is read and written by software using the following procedures. the read procedure uses a prt internal temporary storage register to phi ? 20 internal address/data bus tout timer data register 0l : tmdr0l (8) timer data register 0h : tmdr0h (8) timer reload register 0l : rldr0l (8) timer reload register 0h : rldr0h (8) timer control register : tcr (8) phi ? 20 timer data register 1l : tmdr1l (8) timer data register 1h : tmdr1h (8) timer reload register 1l : rldr1l (8) timer reload register 1h : rldr1h (8) interrupt register
z8018x family mpu user manual 158 um005001-zmp0400 return accurate data without requiring the timer to be stopped. the write procedure requires the prt to be stopped. for reading (without stopping the timer), tmdr is read in the order of lower byte - higher byte (tmdrnl, tmdrnh). the lower byte read (tmdrnl) stores the higher byte value in an internal register. the following higher byte read (tmdrnh) accesses this internal register. this procedure insures timer data validity by eliminating the problem of potential 16-bit timer updating between each 8-bit read. specifically, reading tmdr in higher byte?lower byte order may result in invalid data. note the implications of tmdr higher byte internal storage for applications which may read only the lower and/or higher bytes. in normal operation all tmdr read routines must access both the lower and higher bytes, in that order. for writing, the tmdr down counting must be inhibited using the tde (timer down count enable) bits in the tcr (timer control register). then, any or both higher and lower bytes of tmdr can be freely written (and read) in any order. csi/o transmit/receive data register (trdr: i/o address = 0bh). trdr is used for both csi/o transmission and reception. thus, the system design must insure that the constraints of half-duplex operation are met (transmit and receive operation cannot occur simultaneously). for example, if a csi/o transmission is attempted while the csi/o is receiving data, the csi/o does not work. trdr is not buffered. attempting to perform a csi/o transmit while the previous transmit data is still being shifted out causes the shift data to be immediately updated, thereby corrupting the transmit operation in progress. similarly, reading trdr during a transmit or receive must be avoided.
z8018x family mpu user manual um005001-zmp0400 159 timer reload register (rldr: i/o address = ch0: 0eh, 0fh, chi, 16h, 17h) prt0 and prt1 each contain 16-bit timer reload registers (rldr). rldr0 and rldr1 are each accessed as low and high byte registers (rldr0h, rldr0l and rldr1h, rldr1l). during reset, rldr0 and rldr1 are set to ffffh when the tmdr counts down to 0 , it is automatically reloaded with the contents of rldr. timer data register 0l (tmdr0l: 0ch) bit 7 6 5 4 3 2 1 0 bit/field timer data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable timer data register 0h (tmdr0h: 0dh) bit 7 6 5 4 3 2 1 0 bit/field timer data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable
z8018x family mpu user manual 160 um005001-zmp0400 timer reload register channel 0l (rldr0l: 0eh) bit 7 6 5 4 3 2 1 0 bit/field timer reload data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable timer reload register channel 0h (rldr0l: 0fh) bit 7 6 5 4 3 2 1 0 bit/field timer reload data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable timer data register 1l (tmdr1l: 14h) bit 7 6 5 4 3 2 1 0 bit/field timer data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable timer data register 1h (tmdr1h: 15h) bit 7 6 5 4 3 2 1 0 bit/field timer data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable
z8018x family mpu user manual um005001-zmp0400 161 timer control register (tcr) tcr monitors both channels (prt0, prt1) tmdr status. it also controls enabling and disabling of down counting and interrupts along with controlling output pin a18/tout for prt1. timer reload register channel 1l (rldr1l: 16h) bit 7 6 5 4 3 2 1 0 bit/field timer reload data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable timer reload register channel 1h (rldr1h: 17h) bit 7 6 5 4 3 2 1 0 bit/field timer reload data r/w r/w reset 0 note: r = read w = write x = indeterminate ? = not applicable timer control register (tcr: 10h) bit 7 6 5 4 3 2 1 0 bit/field tif1 tif0 tie1 tie0 toc1 toc0 tde1 tde0 r/w r r r/w r/w r/w r/w r/w r/w reset 0 0 0 0 0 0 0 0 note: r = read w = write x = indeterminate ? = not applicable
z8018x family mpu user manual 162 um005001-zmp0400 bit position bit/field r/w value description 7 ? 6 tif1 ? 0 r tif1: timer interrupt flag ? when tmdr1 decrements to 0, tif1 is set to 1. this generates an interrupt request if enabled by tie1 = 1. tif1 is reset to 0 when tcr is read and the higher or lower byte of tmdr1 is read. during reset, tif1 is cleared to 0. when tmdr0 decrements to 0, tif0 is set to 1. this generates an interrupt request if enabled by tie0 = 1. tif0 is reset to 0 when tcr is read and the higher or lower byte of tmdr0 is read. during reset, tif0 is cleared to 0. 5 ? 4 tie1 ? 0 r/w timer interrupt enable ? when tie1 is set to 1, tif1 = 1 generates a cpu interrupt request. when tie1 is reset to 0, the interrupt request is inhibited. during reset, tie1 is cleared to 0. when tie0 is set to 1, tif0 = 1 generates a cpu interrupt request. when tie0 is reset to 0, the interrupt request is inhibited. during reset, tie0 is cleared to 0. 3 ? 2 toc1 ? 0 r/w timer output control ? toc1, and toc0 control the output of prt1 using the multiplexed a18/tout pin as shown in table23. during reset, toc1 and toc0 are cleared to 0. this selects the address function for a18/ tout. by programming toc1 and toc0 the a18/ tout pin can be forced high, low, or toggled when tmdr1 decrements to 0. reference table23. 1 ? 0 tde1 ? 0 r/w timer down count enable ? tde1 and tde0 enable and disable down counting for tmdr1 and tmdr0 respectively. when tden (n = 0, 1) is set to 1, down counting is executed for tmdrn. when tden is reset to 0, down counting is stopped and tmdrn is freely read or written. tde1 and tde0 are cleared to 0 during reset and tmdrn does not decrement until tden is set to 1.
z8018x family mpu user manual um005001-zmp0400 163 figure 64 illustrates timer initialization, count down, and reload timing. figure 65 depicts timer output (a18/tout) timing. figure 64. timer initialization, count down, and reload timing diagram table 23. timer output control toc1 toc0 output 0 0 inhibited (a18/tout pin is selected as an address output function.) 0 1 toggled 1 0 0 a18/tout pin is selected as a prt1 output function! 1 1 1 timer data register write (0004h) timer data register reset reload reload 20 f 20 f 20 f 20 f 20 f 20 f 20 f 20 f 20 f 0 < + < 20 ffffh 0003h 0002h 0001h 0000h 0003h 0002h 0001h 0000h 0003h 0004h timer reload register write (0003h) timer reload tde flag tif flag timer data register read timer control register read write 1 to tde ffffh 0003h register
z8018x family mpu user manual 164 um005001-zmp0400 figure 65. timer output timing diagram prt interrupts the prt interrupt request circuit is illustrated in figure 66. figure 66. prt interrupt request generation prt and reset during reset, the bits in tcr are initialized as defined in the tcr register description. down counting is stopped and the tmdr and rldr registers are initialized to ffffh . the a18/tout pin reverts to the address output function. tout phi timer data reg. = 0001h timer data reg. = 0000h tif1 tie1 tif0 tie0 ief1 prt1 interrupt request prt0 interrupt request
z8018x family mpu user manual um005001-zmp0400 165 prt operation notes ? tmdr data is accurately read without stopping down counting by reading the lower (tmdrnl*) and higher (tmdrnh*) bytes in that order. also, tmdr is read or written by stopping the down counting. 1 take care to ensure that a timer reload does not occur during or between lower (rldrnl*) and higher (rldrnh*) byte writes. this may be guaranteed by system design/timing or by stopping down counting (with tmdr containing a non-zero value) during the rldr updating. similarly, in applications where tmdr is written at each tmdr overflow, the system/software design must guarantee that rldr can be updated before the next overflow occurs. otherwise, time base inaccuracy occurs. ? during reset, the multiplexed a18/tout pin reverts to the address output. by reprogramming the toc1 and toc0 bits, the timer output function for prt channel 1 is selected. the following paragraph describes the initial state of the tout pin after toc1 and toc0 are programmed to select the prt channel 1 timer output function. prt (channel 1) has not counted down to 0. if the prt has not counted down to 0 (timed out), the initial state of tout depends on the programmed value in toc1 and toc0. secondary bus interface e clock output timing the z8x180 also has a secondary bus interface that allows it to easily interface with other peripheral families. 1. *n = 0, 1
z8018x family mpu user manual 166 um005001-zmp0400 these devices require connection with the z8x180 synchronous e clock output. the speed (access time) required for the peripheral devices are determined by the z8x180 clock rate. table24, and figure 67 through figure 70 define e clock output timing. wait states are inserted in op code fetch, memory read/write, and i/o read/write cycles which extend the duration of e clock output high. during i/o read/write cycles with no wait states (only occurs during on- chip i/o register accesses), e does not go high. table 24. e clock timing in each condition condition duration of e clock output high op code fetch cycle memory read/write cycle t2 rise - t3 fall (1.5 phi + nw x phi) i/o read cycle 1st tw rise - t3 fall (0.5phi + nw x phi) i/o write cycle 1st tw rise - t3 rise in w x phi) nmi acknowledge 1st mc t2 rise - t3 fall (1.5 phi) int0 acknowledge 1st mc 1st tw rise - t3 fall (0.50 + nw x phi ) bus release mode sleep mode system stop mode phi fall - phi fall (2 phi or 1 phi) note: nw = the number of wait states; mc: machine cycle
z8018x family mpu user manual um005001-zmp0400 167 figure 67. e clock timing diagram (during read/write cycle and interrupt acknowledge cycle figure 68. e clock timing in bus release mode op code fetch cycle m1 mreq phi iorq memory read/ write cycle i/o write cycle nmi acknowledge 1st mc int0 acknowledge 1st mc i/o read cycle note : mc = machine cycle * two wait states are automatically inserted e t1 t2 t3 tw* t1 t1 t1 t1 t1 t2 t2 t2 t2 t2 t3 t3 t3 t3 t3 tw tw* phi busreq busack e last state tx tx tx tx bus release mode e e e
z8018x family mpu user manual 168 um005001-zmp0400 figure 69. e clock timing in sleep mode and system stop mode on-chip clock generator the z8x180 contains a crystal oscillator and system clock generator. a crystal can be directly connected or an external clock input can be provided. in either case, the system clock is equal to one-half the input clock. for example, a crystal or external clock input of 8 mhz corresponds with a system clock rate of 4 mhz. z8s180 and z8l180-class processors also have the ability to run at x1 and x2 input clock. table25 describes the at cut crystal characteristics (co, rs) and the load capacitance (cl1, cl2) required for various frequencies of z8x180 operation. e e e t1 t2 t3 ts t1 t1 t2 t2 ts ts ts 76h slp instruction 2nd op code fetch cycle sleep mode or system stop mode op code fetch cycle e phi d0 ? d7 int , nmi
z8018x family mpu user manual um005001-zmp0400 169 if an external clock input is used instead of a crystal, the waveform (twice the clock rate) must exhibit a 50% 10% duty cycle. the minimum clock input high voltage level is v cc ?0.6v. the external clock input is connected to the extal pin, while the xtal pin is left open. figure 70 depicts the external clock interface. figure 70. external clock interface figure 71 illustrates the z8x180 clock generator circuit while figures72 and 72 specify circuit board design rules. table 25. z8x180 operating frequencies 4mhz 4mhz < f 12mhz 12mhz < f 33mhz co < 7 pf < 7 pf < 7 pf rs < 60 w < 60 w < 60 w cl1, cl2 10 to 22 pf 10% 10 to 22 pf 10% 10 to 22 pf 10% clock item frequency note: extal xtal 3 2 open external clock input
z8018x family mpu user manual 170 um005001-zmp0400 figure 71. clock generator circuit figure 72. circuit board design rules z8x180 xtal extal 2 3 64 cl cl note: pin numbers are valid only for dip configuration z8x180 2 3 cl cl signal c a, b signal a b must be avoided
z8018x family mpu user manual um005001-zmp0400 171 figure 73. example of board design circuit board design should observe the following parameters. ? locate the crystal and load capacitors as close to the ic as physically possible to reduce noise. ? signal lines must not run parallel to the clock oscillator inputs. in particular, the clock input circuitry and the system clock output (pin 64) must be separated as much as possible. ? v cc power lines must be separated from the clock oscillator input circuitry. ? resistivity between xtal or extal and the other pins must be greater than 10m ohms. signal line layout must avoid areas marked with the shaded area of figure 73. signal line layout must avoid shaded areas 20 mm max 2 0 m m m a x crystal c l c l 64 2 3 1 gnd z8x180 phi top view note: pin mumbers valid only for dip configuration
z8018x family mpu user manual 172 um005001-zmp0400 miscellaneous free running counter (i/o address = 18h ) if data is written into the free running counter, the interval of dram refresh cycle and baud rates for the asci and csi/o are not guaranteed. in iostop mode, the free running counter continues counting down. it is initialized to ffh during reset. free running counter (frc: 18h) bit 7 6 5 4 3 2 1 0 bit/field counting data r/w r reset ? note: r = read w = write x = indeterminate ? = not applicable
z8018x family mpu user manual 173 um005001-zmp0400 software architecture instruction set the z80180 is object code-compatible with the z80 cpu. refer to the z80 cpu technical manual or the z80 assembly language programming manual for further details. slp - sleep the slp instruction causes the z80180 to enter the sleep low power consumption mode. see page32 for a complete description of the sleep state. table 26. instruction set summary new instructions operation slp enter sleep mode mlt 8-bit multiply with 16-bit result ino g, (m) input contents of immediate i/o address out0 (m), g output register contents to immediate i/o address otim block output - increment otimr block output - increment and repeat otdm block output - decrement otdmr block output - decrement and repeat tstio m non-destructive and, i/o port, and accumulator tst g non-destructive and, register, and accumulator tst m non-destructive and, immediate data, and accumulator tst (hl) non-destructive and, memory data, and accumulator
z8018x family mpu user manual 174 um005001-zmp0400 mlt- multiply the mlt performs unsigned multiplication on two 8-bit numbers yielding a 16-bit result. mlt may specify bc, de, hl, or sp registers. the 8-bit operands are loaded into each half of the 16-bit register and the 16-bit result is returned in that register. otim, otimr, otdm, otdmr - block i/o the contents of memory pointed to by hl is output to the i/o address in (c). the memory address (hl) and i/o address (c) are incremented in otim and otimr and decremented in otdm and otdmr, respectively. the b register is decremented. the otimr and otdmr variants repeat the above sequence until register b is decremented to 0. since the i/o address (c) is automatically incremented or decremented, these instructions are useful for block i/o (such as z80180 on-chip i/o) initialization. when i/o is accessed, 00h is output in high-order bits of address automatically. tstio m - test i/o port the contents of the i/o port addressed by c are anded with immediately specified 8-bit data and the status flags are updated. the i/o port contents are not written (non-destructive and). when i/o is accessed, 00h is output in higher bits of address automatically. tst g - test register perform an and instruction on the contents of the specified register with the accumulator (a) and the status flags are updated. the accumulator and specified register are not changed (non-destructive and ). tst m - test immediate perform an and instruction on the contents of the immediately specified 8-bit data with the accumulator (a) and the status flags are updated. the accumulator is not changed (non-destructive and ).
z8018x family mpu user manual um005001-zmp0400 175 tst (hl) - test memory the contents of memory pointed to by hl are anded with the accumulator (a) and the status flags are updated. the memory contents and accumulator are not changed (non-destructive and). ino g, (m) - input, immediate i/o address the contents of immediately specified 8-bit i/o address are input into the specified register. when i/o is accessed, 00h is output in high-order bits of the address automatically. outo (m), g - output, immediate i/o address the contents of the specified register are output to the immediately specified 8-bit i/o address. when i/o is accessed, 00h is output in high- order bits of the address automatically. cpu registers the z80180 cpu registers consist of register set gr, register set gr' and special registers. the register set gr consists of 8-bit accumulator (a), 8-bit flag register (f), and three general purpose registers (bc, de, and hl) which may be treated as 16-bit registers (bc, de, and hl) or as individual 8-bit registers (b, c, d, e, h, and l) depending on the instruction to be executed. the register set gr' is alternate register set of register set gr and also contains accumulator (a'), flag register (f') and three general purpose registers (bc', de', and hl'). while the alternate register set gr' contents are not directly accessible, the contents can be programmably exchanged at high speed with those of register set gr. the special registers consist of 8-bit interrupt vector register (i), 8-bit r counter (r), two 16-bit index registers (ix and iy), 16-bit stack pointer (sp), and 16-bit program counter (pc)
z8018x family mpu user manual 176 um005001-zmp0400 figure74 depicts cpu register configurations. figure 74. cpu register configurations accumulator (a, a') the accumulator (a) is the primary register used for many arithmetic, logical, and i/o instructions. flag register f b register d register h register c register e register l register general special register interrupt r counter i r index register ix index register iy stack pointer sp program counter pc register set gr accumulator a purpose registers flag register f' b' register d' register h' register c' register e' register l' register general register set gr' accumulator a' purpose registers vector register
z8018x family mpu user manual um005001-zmp0400 177 flag registers (f, f') the flag registers store status bits (described in the next section) resulting from executed instructions. general purpose registers (bc, bc', de, de', hl, hl') the general purpose registers are used for both address and data operation. depending on the instruction, each half (8 bits) of these registers (b, c, d, e, h, and i) may also be used. interrupt vector register (i) for interrupts that require a vector table address to be calculated ( int 0 mode 2, int 1 , int 2 , and internal interrupts), the interrupt vector register (i) provides the most significant byte of the vector table address. i is cleared to 00h during reset. r counter (r) the least significant seven bits of the r counter (r) count the number of instructions executed by the z80180. r increments for each cpu op code fetch cycle (each m 1 cycle). r is cleared to 00h during reset. index registers (ix, and iy) the index registers are used for both address and data operations. for addressing, the contents of a displacement specified in the instruction are added to or subtracted from the index register to determine an effective operand address.
z8018x family mpu user manual 178 um005001-zmp0400 stack pointer (sp) the stack pointer (sp) contains the memory address based lifo stack. sp is cleared to 0000h during reset. program counter (pc) the program counter (pc) contains the address of the instruction to be executed and is automatically updated after each instruction fetch. pc is cleared to 0000h during reset. flag register (f) the flag register stores the logical state reflecting the results of instruction execution. the contents of the flag register are used to control program flow and instruction operation. flag register bit 7 6 5 4 3 2 1 0 bit/field s z not used h not used p/v n c r/w r/w r/w ? r/w ? r/w r/w r/w reset 0 0 ? 0 ? 0 0 0 r = read w = write x = indeterminate ? = not applicable bit position bit/field r/w value description 7 s r/w 0 sign . s stores the state of the most significant bit (bit 7) of the result. this is useful for operations with signed numbers in which values with bit 7 = 1 are interpreted as negative.
z8018x family mpu user manual um005001-zmp0400 179 6 z r/w 0 zero . z is set to 1 when instruction execution produces 0 result. otherwise, z is reset to 0. 5 not used ? ? not used 4 h r/w 0 half carry . h is used by the daa (decimal adjust accumulator) instruction to reflect borrow or carry from the least significant 4 bits and thereby adjust the results of bcd addition and subtraction. 3 not used ? ? not used. 2 p/v r/w 0 p/v: parity/overflow . p/v serves a dual purpose. for logical operations p/v is set to 1 if the number of 1 bit in the result is even and p/v is reset to 0 if the number of 1 in the result is odd. for two complement arithmetic, p/v is set to 1 if the operation produces a result which is outside the allowable range (+ 127 to -128 for 8-bit operations, + 32767 to - 32768 for 16-bit operations). 1 n r/w 0 negative . n is set to 1 if the last arithmetic instruction was a subtract operation (sub, dec, cp, etc.) and n is reset to 0 if the last arithmetic instruction was an addition operation (add, inc, etc.). 0 c r/w 0 carry . c is set to 1 when a carry (addition) or borrow (subtraction) from the most significant bit of the result occurs. c is also affected by accumulator logic operations such as shifts and rotates. bit position bit/field r/w value description
z8018x family mpu user manual 180 um005001-zmp0400 addressing modes the z80180 instruction set includes eight addressing modes. ? implied register ? register direct ? register indirect ? indexed ? extended ? immediate ? relative ? io implied register (imp) certain op codes automatically imply register usage, such as the arithmetic operations that inherently reference the accumulator, index registers, stack pointer, and general purpose registers. register direct (reg) many op codes contain bit fields specifying registers used for operation. the exact bit field definitions vary depending on instruction depicted in figure75.
z8018x family mpu user manual um005001-zmp0400 181 figure 75. register direct ? bit field definitions register indirect (reg) the memory operand address is contained in one of the 16-bit general purpose registers (bc, de, and hl) as illustrated in figure76. figure 76. register indirect addressing g or g field ' 8-bit register register b c d e h l a ? 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 16-bit register zz field register 0 0 0 1 1 0 1 1 b c d e h l a f ww field register 0 0 0 1 1 0 1 1 b c d e h l s p xx field register 0 0 0 1 1 0 1 1 b c d e i x s p yy field register 0 0 0 1 1 0 1 1 b c d e i y s p 0 suffixed h and l ww,xx,yy,zz (ex. wwh,ixl) indicate upper and lower 8-bit of the 16-bit register respectively. b c d e h l operand memory
z8018x family mpu user manual 182 um005001-zmp0400 indexed (indx) the memory operand address is calculated using the contents of an index register (ix or iy) and an 8-bit signed displacement specified in the instruction. refer to figure77 figure 77. indexed addressing extended (ext) the memory operand address is specified by two bytes contained in the instruction, as depicted in figure78. figure 78. extended addressing op code 1 operand memory op code 2 displacement (d) ix or iy op code operand memory n m m n
z8018x family mpu user manual um005001-zmp0400 183 immediate (immed) the memory operands are contained within one or two bytes of the instruction, as depicted in figure79. figure 79. immediate addressing relative (rel) relative addressing mode is only used by the conditional and unconditional branch instructions (refer to figure80). the branch displacement (relative to the contents of the program counter) is contained in the instruction. figure 80. relative addressing op code n m m 16-bit operand op code 8-bit operand op code displacement (d) program counter (pc)
z8018x family mpu user manual 184 um005001-zmp0400 io (i/o) io addressing mode is used only by i/o instructions. this mode specifies i/o address ( iorq is 0 ) and outputs them as follows. 1. an operand is output to a0 ? a7. the contents of accumulator is output to a8 ? a15. 2. the contents of register b is output to a0 ? a7. the contents of register c is output to a8 ? a15. 3. an operand is output to a0 ? a7. 00h is output to a8 ? a15 (useful for internal i/o register access) 4. the contents of register c is output to a0 ? a7. 00h is output to a8 ? a15 (useful for internal i/o register access).
z8018x family mpu user manual 185 um005001-zmp0400 dc characteristics this section describes the dc characteristics of the z8x180 family and absolute maximum rating for these products. absolute maximum rating permanent ic damage may occur if maximum ratings are exceeded. normal operation should be under recommended operating conditions. if these conditions are exceeded, it could affect reliability of ic. table 27. absolute maximum rating item symbol value unit supply voltage vcc - 0.3 ~ + 7.0 v input voltage vin -0.3 ~ vcc+0.3 v operating temperature topr 0 ~ 70 c extended temperature text -40 ~ 85 c storage temperature tstg - 55 ~ +150 c
z8018x family mpu user manual 186 um005001-zmp0400 z80180 dc characteristics v cc = 5v 10%, v ss = ov, ta = 0 to +70 c, unless otherwise noted.) table 28. z80180 dc characteristics symbol item condition minimum typical maximum unit vih1 input high voltage reset , extal nmi v cc ?0.6 ? v cc +0.3 v vih2 input high voltage except reset , extal nmi 2.0 v cc +0.3 v vil1 input low voltage reset , extal nmi ?0.3 0.6 v vil2 input low voltage except reset , extal nmi ?0.3 0.8 standard 7 tl vil v voh output high voltage all outputs ioh = ?200 m a ioh = ?20 m a 2.4 v cc ?1.2 ? ? ? ? v v vol output low voltage all outputs iol = 2.2 ma ? ? 0.45 v i il input leakage current all inputs except xtal, extal v in = 0.5~ v cc ?0.5 ? ? 1.0 m a itl three-state leakage current ? ? 1.0 m a icc power dissipation* (normal operation) f = 6 mhz f = 8 mhz f = 33 mhz ? ? ? 15 20 25 40 50 60 ma ma ma
z8018x family mpu user manual um005001-zmp0400 187 z8s180 dc characteristics v cc = 5v 10%, v ss = ov, ta = 0 to +70 c, unless otherwise noted. power dissipation* (system stop mode) f = 6 mhz f = 8 mhz f = 33 mhz ? ? ? 3.8 5 6.3 12.5 15.0 17.5 ma ma ma cp pin capacitance vin = 0v, f = 1mhz ta = 25c ? ? 12 pf notes: * vin min = v cc ?1.0v. vil max = 0.8v (all output terminals are a no load.) vcc = 5.0v table 29. z8s180 dc characteristics symbol item condition minimum typical maximum unit vih1 input high voltage reset , extal nmi v cc ?0.6 ? v cc +0.3 v vih2 input high voltage except reset , extal nmi 2.0 v cc +0.3 v vih3 input high voltage cks, cka0, cka1 2.4 v dd + 0.3 v vil1 input low voltage reset , extal nmi ?0.3 0.6 v vil2 input low voltage except reset , extal nmi ?0.3 0.8 v table 28. z80180 dc characteristics (continued) symbol item condition minimum typical maximum unit
z8018x family mpu user manual 188 um005001-zmp0400 voh1 output high voltage all outputs ioh = ?200 m a ioh = ?20 m a 2.4 v cc ?1.2 ? ? ? ? v v voh2 output high voltage output high phi ioh = ?200 m a v cc ?0.6 vol1 output low voltage all outputs iol = 2.2 ma ? ? 0.45 v vol2 output low voltage output low phi iol = 2.2 ma ? ? 0.45 v iil input leakage current all inputs except xtal, etal vin = 0.5 ~ vcc ?0.5 ? ? 1.0 m a itl three-state leakage current vin = 0.5 ~ vcc ?0.5 ? ? 1.0 m a icc power dissipation* (normal operation) f = 10 mhz f = 20 mhz f = 33 mhz ? 15 30 60 ? 50 100 ma power dissipation* (system stop mode) f = 10 mhz f = 20 mhz f = 33 mhz ? 1.5 3 5 ? 6 9 ma power dissipation* (idle mode) f = 20 mhz f = 33 mhz ? 4 10 ma power dissipation* (standby mode) external oscillator, internal clock stops ? 5 10 m a cp pin capacitance vin = 0v, f = 1mhz ta = 25c ? ? 12 pf notes: * vin min = v cc ?1.0v. vil max = 0.8v (all output terminals are a no load.) v cc = 5.0v table 29. z8s180 dc characteristics (continued) symbol item condition minimum typical maximum unit
z8018x family mpu user manual um005001-zmp0400 189 z8l180 dc characteristics v cc = 3.3v 10%, v ss = ov, ta = 0 to +70 c, unless otherwise noted.) table 30. z8l180 dc characteristics symbol item condition minimum typical maximum unit vih1 input high voltage reset , extal nmi v cc ?0.6 ? v cc +0.3 v vih2 input high voltage except reset , extal nmi 2.0 v cc +0.3 v vil1 input low voltage reset , extal nmi ?0.3 0.8 v vil2 input low voltage except reset , extal nmi ?0.3 0.8 v voh1 output high voltage all outputs ioh = ?200 m a 2.4 v voh2 output high voltage output high phi ioh = ?200 m a v cc ?0.6 v vol output low voltage all outputs iol = 4 ma ? ? 0.4 v vol2 output low voltage output low phi iol = 4 ma ? ? 0.4 v iil input leakage current all inputs except xtal, extal vin = 0.5 ~ vcc ?0.5 ? ? 1.0 m a itl three-state leakage current vin = 0.5 ~ vcc ?0.5 ? ? 1.0 m a
z8018x family mpu user manual 190 um005001-zmp0400 icc power dissipation* (normal operation) f = 20 mhz 20 100 ma power dissipation* (system stop mode) f = 20 mhz 2 10 ma power dissipation* (idle mode) f = 20 mhz 3 10 ma power dissipation* (standby mode) external oscillator, internal clock stops 4 10 m a cp pin capacitance vin = 0v, f = 1mhz ta = 25c ? ? 12 pf notes: * vin min = v cc ?1.0v. vil max = 0.8v (all output terminals are a no load.) v cc = 3.3v table 30. z8l180 dc characteristics (continued) symbol item condition minimum typical maximum unit
z8018x family mpu user manual um005001-zmp0400 191 5 4 3 2 1 2.7 3.0 3.3 v dd (volts) i c c a c t i v e ( m a . ) typical icca at 4 mhz z8l180 50 40 30 20 10 2 3 4 v dd (volts) i c c a c t i v e ( m a . ) typical icca at 20 mhz z8s180 5
z8018x family mpu user manual 192 um005001-zmp0400
z8018x family mpu user manual 193 um005001-zmp0400 ac characteristics this section describes the ac characteristics of the z8x180 family and absolute maximum rating for these products. ac characteristics ? z8s180 table 31. z8s180 ac characteristic s v dd = 5v 10% or v dd = 3.3v 10%; 33-mhz characteristics apply only to 5v operation no. symbo l item z8s180 ? 20 mhz z8s180 ? 33 mhz uni t min max min max 1 t cyc clock cycle time 50 dc 30 dc ns 2 t chw clock ?h? pulse width 15 ? 10 ? ns 3 t clw clock ? l ? pulse width 15 ? 10 ? ns 4 t cf clock fall time ? 10 ? 5 ns 5 t cr clock rise time ? 10 ? 5 ns 6 t ad phi rise to address valid delay ? 30 ? 15 ns 7 t as address valid t o mreq fall or iorq fall) 5 ? 5 ? ns 8 t med1 phi fall t o mreq fall delay ? 25 ? 15 ns 9 t rdd1 phi fall t o rd fall delay ioc = 1 ? 25 ? 15 ns phi rise t o rd rise delay ioc = 0 ? 25 ? 15 10 t m1d1 phi rise t o m1 fall delay ? 35 ? 15 ns 11 t ah address hold time from mreq , ioreq , rd , wr high 5 ? 5 ? ns 12 t med2 phi fall t o mreq rise delay ? 25 ? 15 ns
z8018x family mpu user manual 194 um005001-zmp0400 13 t rdd2 phi fall t o rd rise delay ? 25 ? 15 ns 14 t m1d2 phi rise t o m1 rise delay ? 40 ? 15 ns 15 t drs data read set-up time 10 ? 5 ? ns 16 t drh data read hold time 0 ? 0 ? ns 17 t std1 phi fall to st fall delay ? 30 ? 15 ns 18 t std2 phi fall to st rise delay ? 30 ? 15 ns 19 t ws wait set-up time to phi fall 15 ? 10 ? ns 20 t wh wait hold time from phi fall 10 ? 5 ? ns 21 t wdz phi rise to data float delay ? 35 ? 20 ns 22 t wrd1 phi rise t o wr fall delay ? 25 ? 15 ns 23 t wdd phi fall to write data delay time ? 25 ? 15 ns 24 t wds write data set-up time t o wr fall 10 ? 10 ? ns 25 t wrd2 phi fall t o wr rise delay ? 25 ? 15 ns 26 t wrp wr pulse width (memory write cycle) 80 ? 45 ? ns 26a wr pulse width (i/o write cycle) 150 ? 70 ? ns 27 t wdh write data hold time fro m wr ris e 10 ? 5 ? ns 28 t iod1 phi fall t o iorq fall delay ioc = 1 ? 25 ? 15 ns phi rise t o iorq fall delay ioc = 0 ? 25 ? 15 29 t iod2 phi fall t o iorq rise delay ? 25 ? 15 ns 30 t iod3 m1 fall t o iorq fall delay 125 ? 80 ? ns 31 t ints int set-up time to phi fall 20 ? 15 ? ns 32 t inth int hold time from phi fall 10 ? 10 ? ns table 31. z8s180 ac characteristic s (continued) v dd = 5v 10% or v dd = 3.3v 10%; 33-mhz characteristics apply only to 5v no. symbo l item z8s180 ? 20 mhz z8s180 ? 33 mhz uni t min max min max
z8018x family mpu user manual um005001-zmp0400 195 33 t nmiw nmi pulse width 35 ? 25 ? ns 34 t brs busreq set-up time to phi fal l 10 ? 10 ? ns 35 t brh busreq hold time from phi fal l 10 ? 10 ns 36 t bad1 phi rise t o busack fall delay ? 25 ? 15 ns 37 t bad2 phi fall t o busack rise delay ? 25 ? 15 ns 38 t bzd phi rise to bus floating delay tim e ? 40 ? 30 ns 39 t mewh mreq pulse width (high) 35 ? 25 ? ns 40 t mewl mreq pulse width (low) 35 ? 25 ? ns 41 t rfd1 phi rise t o rfsh fall delay ? 20 ? 15 ns 42 t rfd2 phi rise t o rfsh rise delay ? 20 ? 15 ns 43 t had1 phi rise t o halt fall delay ? 15 ? 15 ns 44 t had2 phi rise t o halt rise delay ? 15 ? 15 ns 45 t drqs dreq1 set-up time to phi ris e 20 ? 15 ? ns 46 t drqh dreq1 hold time from phi ris e 20 ? 15 ? ns 47 t ted1 phi fal l t o tendi fal l delay ? 25 ? 15 ns 48 t ted2 phi fall t o tendi ris e delay ? 25 ? 15 ns 49 t ed1 phi ris e to e ris e delay ? 30 ? 15 ns 50 t ed2 phi fall or ris e to e fal l delay ? 30 ? 15 ns 51 p weh e pulse width (high) 25 ? 20 ? ns 52 p wel e pulse width (low) 50 ? 40 ? ns 53 t er enable rise time ? 10 ? 10 ns 54 t ef enable fall time ? 10 ? 10 ns 55 t tod phi fal l to timer output delay ? 75 ? 50 ns table 31. z8s180 ac characteristic s (continued) v dd = 5v 10% or v dd = 3.3v 10%; 33-mhz characteristics apply only to 5v no. symbo l item z8s180 ? 20 mhz z8s180 ? 33 mhz uni t min max min max
z8018x family mpu user manual 196 um005001-zmp0400 56 t stdi csi/o transmit data delay time (internal clock operation) ? 2 ? 2 tcyc 57 t stde csi/o transmit data delay time (external clock operation) ? 7. 5 t cy c +75 ? 7 5 t cyc +60 ns 58 t srsi csi/o receive data set-up time (internal clock operation) 1 ? 1 ? tcyc 59 t srhi csi/o receive data hold time (internal clock operation) 1 ? 1 ? tcyc 60 t srse csi/o receive data set-up time (external clock operation) 1 ? 1 ? tcyc 61 t srhe csi/o receive data hold time (external clock operation) 1 ? 1 ? tcyc 62 t res reset set-up time to phi fall 40 ? 25 ? ns 63 t reh reset hold time from phi fall 25 ? 15 ? ns 64 t osc oscillator stabilization time ? 20 ? 20 ns 65 t exr external clock rise time (extal ) ? 5 ? 5 ns 66 t exf external clock fall time (extal) ? 5 ? 5 ns 67 t rr reset rise time ? 50 ? 50 ms 68 t rf reset fall time ? 50 ? 50 ms 69 t ir input rise time (except extal, reset ) ? 50 ? 50 ns 70 t if input fall time (except extal, reset ) ? 50 ? 50 ns table 31. z8s180 ac characteristic s (continued) v dd = 5v 10% or v dd = 3.3v 10%; 33-mhz characteristics apply only to 5v no. symbo l item z8s180 ? 20 mhz z8s180 ? 33 mhz uni t min max min max
z8018x family mpu user manual um005001-zmp0400 197
z8018x family mpu user manual 197 um005001-zmp0400 timing diagrams figure 81. ac timing diagram 1 phi address wait mreq iorq rd wr m1 st data in data out reset 11 67 68 62 63 68 67 62 63 15 16 17 10 14 9 22 13 11 28 7 29 7 8 20 19 19 20 11 12 6 9 13 25 11 opcode fetch cycle t 1 1 2 3 4 5 15 16 21 27 18 i/o write cycle* i/o read cycle* t 2 t w t 3 t 1 t 2 t w t 3 t 1 23 24 26
z8018x family mpu user manual 198 um005001-zmp0400 memory read/write cycle timing is the sam as i/o read/write cycle except there are no automatica wait states (tw), and mreq is active instead of iorq. figure 82. ac timing diagram 2 phi int0,1,2 31 32 33 40 30 28 15 16 29 39 41 42 34 35 34 35 36 37 38 38 43 44 14 10 nmi m1 iorq data in mreq rfsh busreq busack mreq , rd wr , iorq halt output buffer off a19?0, d7?0
z8018x family mpu user manual um005001-zmp0400 199 figure 83. cpu timing ( ioc = 0) (i/o read cycle, i/o write cycle) t 1 t 2 t w t 3 t 1 t 2 t w t 3 address phi rd iorq wr 28 9 29 28 29 13 22 25 i/o read cycle i/o write cycle cpu timing ( ioc = 0) i/o read cycle i/o write cycle
z8018x family mpu user manual 200 um005001-zmp0400 figure 84. dma control signals 47 45 46 48 18 (level sense) dreq1 (edge sense) tendi st phi t 1 t 2 t w t 3 t 1 17 dreq1 cpu or dma read/write cycle (only dma write cycle for tendi ) 45 46 * ** cpu cycle starts dma cycle starts notes: *t drqs and t drqh are specified for the rising edge of the clock followed by t 3 . **t drqs and t drqh are specified for the rising edge of the clock.
z8018x family mpu user manual um005001-zmp0400 201 figure 85. e clock timing (memory r/w cycle) (i/o r/w cycle) figure 86. e clock timing (bus release mode, sleep mode, and system stop mode 49 49 49 15 50 50 50 16 d 0 ?d 7 e (memory read/ write ) e (i/o read) e (i/o write) phi ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ t 1 t 2 t w t w t 3 phi e bus release mode sleep mode system stop mode 49 50
z8018x family mpu user manual 202 um005001-zmp0400 figure 87. e clock timing (minimum timing example of pwel and pweh) figure 88. timer output timing 50 52 53 49 53 t 2 t 2 t w t 3 t 1 54 49 51 54 50 e example i/o read ? opcode fetch phi e (i/o write) 55 timer data reg. = 0000h a18/t out phi
z8018x family mpu user manual um005001-zmp0400 203 figure 89. slp execution cycle timing diagram 32 44 43 33 a 19 ?a 0 slp instruction fetch mreq , m1 nmi inti halt phi ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ t 1 t 2 t s t s t 3 t 1 t 2 31 rd next opcode fetch ~ ~ ~ ~
z8018x family mpu user manual 204 um005001-zmp0400 figure 90. csi/o receive/transmit timing diagram figure 91. external clock rise time and fall time figure 92. input rise time and fall time (except extal, reset ) 57 56 58 56 11.5t cyc transmit data 59 58 59 11.5t cyc 11t cyc 16.5t cyc 11t cyc 16.5t cyc 57 60 61 60 61 (external clock) transmit data (internal clock) receive data (external clock) receive data (internal clock) csi/o clock extal vil1 vih1 vil1 vih1 65 66 70 69
z8018x family mpu user manual um005001-zmp0400 205 standard test conditions the previous dc characteristics and capacitance sections apply to the following standard test conditions, unless otherwise noted. all voltages are referenced to gnd (0v). positive current flows in to the referenced pin. all ac parameters assume a load capacitance of 100 pf. add 10 ns delay for each 50 pf increase in load up to a maximum of 200 pf for the data bus and 100 pf for the address and control lines. ac timing measurements are referenced to 1.5 volts (except for clock, which is referenced to the 10% and 90% points). the ordering information section lists temperature ranges and product numbers. package drawings are in the package information section. refer to the literature list for additional documentation. figure 93. test setup +5v 2.1k w 100 pf from output under test 200 m a v
z8018x family mpu user manual 206 um005001-zmp0400
z8018x family mpu user manual 207 um005001-zmp0400 instruction set this section explains the symbols in the instruction set. register g, g', ww, xx, yy, and zz specify a register to be used. g and g' specify an 8-bit register. ww, xx, yy, and zz specify a pair of 8-bit registers. table32 describes the correspondence between symbols and registers. note: suffixed h and l to ww, xx, yy, zz (ex. wwh, ixl) indicate upper and lower 8-bit of the 16-bit register respectively. bit b specifies a bit to be manipulated in the bit manipulation instruction. table33 indicates the correspondence between b and bits. table 32. register values g,g' reg. ww reg. xx reg. yy reg. zz reg. 000 b 00 bc 00 bc 00 bc 00 bc 001 c 01 de 01 de 01 de 01 de 010 d 10 hl 10 ix 10 iy 10 hl 011 e 11 sp 11 sp 11 sp 11 af 100 h 101 l 111 a
z8018x family mpu user manual 208 um005001-zmp0400 condition f specifies the condition in program control instructions. table34 describes the correspondence between f and conditions. table 33. bit values b bit 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7 table 34. instruction values f condition 000 nz nonzero 001 z zero 010 nc non carry 011 c carry 100 po parity odd 101 pe parity even 110 p sign plus 111 m sign minus
z8018x family mpu user manual um005001-zmp0400 209 restart address v specifies a restart address. table35 describes the correspondence between v and restart addresses. flag the symbols listed in table36 indicate the flag conditions. table 35. address values v address 000 00h 001 08h 010 l0h 011 18h 100 20h 101 28h 110 30h 111 38h table 36. flag conditions not affected - affected x undefined s set to 1 r reset to 0 p parity v overflow
z8018x family mpu user manual 210 um005001-zmp0400 miscellaneous table37 lists the operations mnemonics. table 37. operations mnemonics () m data in the memory address () i data in the i/o address m or n 8-bit data mn 16-bit data r 8-bit register r 16-bit register b.() m a content of bit b in the memory address b.gr a content of bit b in the register gr d or j 8-bit signed displacement s source d destination and operation + or operation ? exclusive or operation ** added new instructions to z80
z8018x family mpu user manual um005001-zmp0400 211 data manipulation instructions table 38. arithmetic and logical instructions (8-bit) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c add add a,g 10 000 g s d 1 4 ar + gr ? ar - - - v r - add a, (hl) 10 000 110 s d 1 6 ar + (hl) m ? ar - - - v r - add a, m 11 000 110 s d 2 6 ar + m ? ar - - - v r - < m > add a,(ix + d) 11 011 101 s d 3 14 ar + (ix + d) m ? ar - - - v r - 10 000 110 < d > add a,(iy + d) 11 111 101 s d 3 14 ar + (iy + d)) m ? ar - - - v r - 10 000 i10 < d > adc adc a,g 10 001 g s d 1 4 ar + gr + c ? ar - - - v r - adc a,(hl) 10 001 110 s d 1 6 ar + (hl) m + c ? ar - - - v r - adc a,m 11 001 110 s d 2 6 ar + m + c ? ar - - - v r - < m > adc a,(ix + d) 11 011 101 s d 3 14 ar + (lx + d)) m + c ? ar - - - v r - 10 001 110 < d > adc a,(iy + d) 11 111 101 s d 3 14 ar + (iy + d)) m + c ? ar - - - v r - 10 001 110 < d >
z8018x family mpu user manual 212 um005001-zmp0400 and and g 10 100 g s d 1 4 ar*gr ? ar - - s p r r and (hl) 10 100 110 s d 1 6 ar*(hl) m ? ar - - s p r r and m 11 100 110 s d 2 6 ar*m ? ar - - s p r r < m > and (ix + d) 11 011 101 s d 3 14 ar*(1x + d)) m ? ar - - s p r r 10 100 110 < d > and (iy + d) 11 111 101 s d 3 14 ar*(1y + d)v ? ar - - s p r r 10 100 110 < d > compare cp g 10 111 g s d 1 4 ar-gr - - - v s - cp (hl) 10 111 110 s d 1 6 ar-(hl) m - - - v s - cp m 11 111 110 s d 2 6 ar-m - - - v s - < m > cp (ix + d) 11 011 101 s d 3 14 ar-(ix + d)) m - - - v s - 10 111 110 < d > cp (iy + d) 11 111 101 s d 3 14 ar-(iy + d)) m - - - v s - 10 111 110 < d > compleme nt cpl 00 101 111 s/d 1 3 ar ? ar s s table 38. arithmetic and logical instructions (8-bit) (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 213 dec dec g 00 g 101 s/d 1 4 gr-1 ? gr - - - v s dec (hl) 00 110 101 s/d 1 10 (hl) m -1 ? (hl) m - - - v s dec (ix + d) 11 011 101 s/d 3 18 (ix + d)) m -i ? - - - v s 00 110 101 (ix + d)) m < d > dec (iy + d) 11 111 101 s/d 3 18 (iy + d) m -1 ? - - - v s 00 1101 01 (iy + d) m < d > inc inc g 00 g 100 s/d 1 4 gr + i ? gr - - - v r inc (hl) 00 110 100 s/d 1 10 (hl) m + i ? (hl) m - - - v r inc (ix + d) 11 011 101 s/d 3 18 (ix + d)) m + 1 ? - - - v r 00 110 100 (1x + d)) m < d > inc (iy + d) 11 111 101 s/d 3 18 (iy + d)v + 1 ? - - - v r 00 110 100 (iy + d)v < d > mult mlt ww** 11 101 101 s/d 2 17 wwhr ? wwlr ? wwi 01 wwi 100 negate neg 11 101 101 s/d 2 6 0-ar ? ar - - - y s - 01 000 100 table 38. arithmetic and logical instructions (8-bit) (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual 214 um005001-zmp0400 or or g 10 110 g s d 1 4 ar + gr ? ar - - r p r r or (hl) 10 110 110 s d 1 6 ar + (hl) m ? ar - - r p r r or m 11 110 110 s d 2 6 ar + m ? ar - - r p r r < m > or (ix + d) 11 011 101 s d 3 14 ar + (ix + d) m ? ar - - r p r r 10 110 110 < d > or (iy + d) 11 111 101 s d 3 14 ar + (iy + d) m ? ar - - r p r r 10 110 110 < d > sub sub g 10 010 g s d 1 4 ar-gr ? ar - - - v s - sub (hl) 10 010 110 s d 1 6 ar-(hl) m ? ar - - - v s - sub m 11 010 110 s d 2 6 ar-m ? ar - - - v s - < m > sub (ix + d) 11 011 101 s d 3 14 ar-(ix + d) m -c ? ar - - - v s - 10 011 110 < d > sub (iy + d) 11 111 101 s d 3 14 ar-(iy + d) m -c ? ar - - - v s - 10 010 110 < d > table 38. arithmetic and logical instructions (8-bit) (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 215 subc sbc a,g 10 011 g s d 1 4 ar-gr-c ? ar - - - v s - sbc a,(hl) 10 011 110 s d 1 6 ar-(hl) m -c ? ar - - - v s - sbc a,m 11 011 110 s d 2 6 ar-m-c ? ar - - - v s - < m > sbc a,(ix + d) 11 011 101 s d 3 14 ar-(ix + d) m -c ? ar - - - v s - 10 011 110 < d > sbc a,(iy + d) 11 111 101 s d 3 14 ar-(iy + d) m -c ? ar - - - v s - 10 011 110 < d > test tst g** 11 101 101 s 2 7 ar gr - - s p r r 00 g 100 tst {hl)** 11101101 s 2 10 ar (hl) m - - s p r r 00 110 100 tst m** 11 101 101 s 3 9 ar m - - s p r r 01 100 100 < m > xor xor g 10 101 g s d 1 4 ar ? + gr ? ar - - r p r r xor (hl) 10 101 110 s d 1 6 ar ? + (hl) m ? ar - - r p r r xor m 11 101 110 s d 2 6 ar ? + m ? ar - - r p r r < m > xor (ix + d) 11 011 101 s d 3 14 ar ? + (ix + d) ) m ? ar - - r p r r 10 101 110 table 38. arithmetic and logical instructions (8-bit) (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual 216 um005001-zmp0400 xor (iy + d) 11 111 101 s d 3 14 ar ? + (iy + d) ) m ? ar - - r p r r 10 101 110 table 39. rotate and shift instructions operation name mnemonics op code addressing bytes state s operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c rotate and shift data rl a 00 010 1111 s/d 1 3 r r - rl g 11 001 011 s/d 2 7 - - r p r - 00 010 g rl (hl) 11 001 011 s/d 2 13 - - r p r - 00 010 110 rl (ix + d) 11 011 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 010 110 rl (iy + d) 11 111 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 010 110 rlc a 00 000 111 s/d 1 3 r r - rlc g 11 001 011 s/d 2 7 - - r p r - 00 000 g rlc (hl) 11 001 011 s/d 2 13 - - r p r - 00 000 110 table 38. arithmetic and logical instructions (8-bit) (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c c b7 b0 b7 b0 b7 b0 ar (hl) m c b7 b0
z8018x family mpu user manual um005001-zmp0400 217 rlc (ix + d) 11 011 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 000 110 rlc (iy + d) 11 111 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 000 110 rld 11 101 101 s/d 2 16 - - r p r 01 101 111 rra 00 011 111 s/d 1 3 r r - rrg 11 001 011 s/d 2 7 - - r p r - 00 011 g rr (hl) 11 001 011 s/d 2 13 - - r p r - 00 011 110 rr (ix + d) 11 011 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 011 110 rr (iy + d) 11 111 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 011 110 rrca 00 001 111 s/d 1 3 r r - rrc g 11 001 011 s/d 2 7 - - r p r - 00 001 g rrc (hl) 11 001 011 s/d 2 13 - - r p r - 00 001 110 rrc (ix + d) 11 011 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 001 110 rrc (iy + d) 11 111 101 s/d 4 19 - - r p r - table 39. rotate and shift instructions (continued) operation name mnemonics op code addressing bytes state s operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c c b7 b0 c b7 b0
z8018x family mpu user manual 218 um005001-zmp0400 11 001 011 < d > 00 001 110 rrd 11 101 101 s/d 2 16 - - r p r 01 100 111 sla g 11 001 011 s/d 2 7 - - r p r - 00 100 g sla (hl) 11 001 011 s/d 2 13 - - r p r - 00 100 110 sla (ix + d) 11 011 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 100 110 sla (iy + d) 11 111 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 100 110 sra g 11 001 011 s/d 2 7 - - r p r - 00 101 g sra (hl) 11 001 011 s/d 2 13 - - r p r - 00 101 110 sra (ix + d) 11 011 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 101 110 sra (iy + d) 11 111 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 101 110 srl g 11 001 011 s/d 2 7 - - r p r - 00 111 g table 39. rotate and shift instructions (continued) operation name mnemonics op code addressing bytes state s operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c b7 b0 ar (hl) m c b7 b0 0 b7 b0 c b7 b0 c b7 b0 0
z8018x family mpu user manual um005001-zmp0400 219 srl (hl) 11 001 011 s/d 2 3 - - r p r - 00 111 110 srl (ix + d) 11 011 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 111 110 srl (iy + d) 11 111 101 s/d 4 19 - - r p r - 11 001 011 < d > 00 111 110 bit set set b,g 11 001 011 s/d 2 7 1 ? b gr 11 b g set b,(hl) 11 001 011 s/d 2 13 1 ? b (hl) m 11 b 110 set b,(ix + d) 11 011 101 s/d 4 19 1 ? b (ix + d) m 11 001 011 < d > 11 b 110 set b,(iy + d) 11 111 101 s/d 4 19 l ? b (iy + d) m 11 001 011 < d > 11 b 110 bit reset res b,g 11 001 011 s/d 2 7 0 ? b gr 10 b g res b,(hl) 11 001 011 s/d 2 13 0 ? 6*b (hl) m 10 b 110 res b,(ix + d) 11 011 101 s/d 4 19 0 ? b (ix + d) m 11 001 011 < d > 10 b 110 table 39. rotate and shift instructions (continued) operation name mnemonics op code addressing bytes state s operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual 220 um005001-zmp0400 bit reset res b,(iy + d) 11 011 101 s/d 4 19 0 ? b (iy + d) m 11 001 01l < d > 10 b 110 bit test bit b, g 11 001 011 s 2 6 b gr ? z x - s x r 01bg bit b,(hl) 11 001 011 s 2 9 b (hl) m ? z x - s x r 01 b 110 bit b,(ix + d) 11 011 101 s 4 15 b (ix + d) m ? z x - s x r 11 001 011 < d > 01 b 110 bit b,(iy + d) 11 111 101 s 4 15 b (iy + d) m ? z x - s x r 11 001 011 < d > 01 b 110 table 39. rotate and shift instructions (continued) operation name mnemonics op code addressing bytes state s operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 221 table 40. arithmetic instructions (16-bit) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c add add hl,ww 00 ww1 001 s d 1 7 hl r + ww r ? hl r x r - add ix,xx 11 011 101 s d 2 10 ix r + xx r ? *ix r x r - 00 xx1 001 add iy,yy 11 111 101 s d 2 10 iy r + yy r ? iy r x r - 00 yy1 001 adc adc hl,ww 11 101 101 s d 2 10 hl r + ww r + c ? hl r - - x v r - 01 ww1 010 dec dec ww 00 ww1 011 s/d 1 4 ww r -1 ? ww r dec ix 11 011 101 s/d 2 7 1x r -1 ? ix r 00 101 011 dec iy 11 111 101 s/d 2 7 1y r -1 ? iy r 00 101 011 inc inc ww 00 ww 0011 s/d 1 4 ww r + 1 ? ww r inc ix 11 011 101 s/d 2 7 1x r + 1 ? ix r 00 100 011 inc iy 11 111 101 s/d 2 7 1y r + 1 ? iy r 00 100 011 sbc sbc hl ww 11 101 101 s d 2 10 hl r -ww r -c ? hl r - - x v s - 01 ww0 010
z8018x family mpu user manual 222 um005001-zmp0400 data transfer instructions table 41. 8-bit load operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c load 8-bit data ld a,i 11 101 101 s/d 2 6 1r ? ar - - r ief2 r 01 010 111 ld a,r 11 101 101 s/d 2 6 rr ? ar - - r ief2 r 01 011 111 ld a,(bc) 00 001 010 s d 1 6 (bc) m ? ar ld a,(de) 00 011 010 s d 1 6 (de) m ? ar ld a,(mn) 00 111 010 s d 3 12 (mn) m ? ar < n > < m > ld l,a 11 101 101 s/d 2 6 ar ? ir 01 000 111 ld r,a 11 101 101 s/d 2 6 ar ? rr 01 001 111 ld (bc),a 00 000 010 d s 1 7 ar ? (bc) m ld(de),a 00 010 010 d s 1 7 ar ?( de) m ld (mn),a 00 110 010 d s 3 13 ar ? (mn) m < n > < m > ld gg? 01 g g? s/d 1 4 gr? ? gr ld g,(hl) 01 g 110 d s 1 6 (hl) m ? gr ld g,m 00 g 110 s d 2 6 m ? gr < m > ld g,(ix + d) 11 011 101 s d 3 14 (ix + d) m gr 01 g 110 < d > ld g,(iy + d) 11 111 101 s d 3 14 (iy + d) m ? gr 01 g 110 < d > ld (hl),m 00 110 110 s d 2 9 m ? (hl) m < m >
z8018x family mpu user manual um005001-zmp0400 223 load 8-bit data ld (ix + d),m 11 011 101 s d 4 15 m ? (ix + d) m 00 110 110 < d > ld (iy + d),m 11 111 101 s d 4 15 m ? (iy + d) m 01 110 g < d > ld (hl),g 01 110 g s d 1 7 gr ? (hl) m ld (ix + d),g 11 011 101 d s 3 15 gr ? (ix+d) m 01 110 g ld (iy + d),g 11 111 101 d s 3 15 gr ? (iy + d) m 01 110 g < d > (1) in the case of r1 and z mask, interrupts are not sampled at the end of ld a, i or ld a,r. table 42. 16-bit load operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c load 16-bit data ld ww,mn 00 ww0 001 s d 3 9 mn ? ww r < n > < m > ld ix,mn 11 011 101 s d 4 12 mn ? ix r 00 100 001 < n > < m > table 41. 8-bit load (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual 224 um005001-zmp0400 load 16-bit data ld iy,mn 11 111 101 s d 4 12 mn ? iy r 00 100 001 < n > < m > ld sp,hl 11 111 001 s/d 1 4 hi r ? sp r ld sp,ix 11 011 101 s/d 2 7 ix r -sp r 11 111 001 ld sp,iy 11 111 101 s/d 2 7 iy r ? sp r 11 111 001 ld ww,(mn) 11 101 101 s d 4 18 (mn + 1) m ? wwhr 01 ww1 011 (mn) m ? wwlr < n > < m > ld hl,(mn) 00 101 010 s d 3 15 (mn + 1) m ? hr < n > (mn) m ? lr < m > ld ix,(mn) 11 011 101 s d 4 18 (mn + 1) m ? ixhr 00 101 010 (mn) m ? ixlr < n > < m > ld iy,(mn) 11 111 101 s d 4 18 (mn + 1) m ? iyhr 00 101 010 (mn) m ? iylr < n > < m > ld (mn),ww 11 101 101 d s 4 19 wwhr ? (mn + 1) m 01 ww0 011 wwlr ? (mn) m < n > < m > table 42. 16-bit load (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 225 load 16-bit data ld (mn),hl 00 100 010 d s 3 16 hr ? (mn + 1) m < n > lr ? (mn) m < m > ld (mn),ix 11 011 101 d s 4 19 ixhr-(mn + 1) m 00 100 010 ixlr ? (mn) m < n > < m > ld (mn),iy 11 111 101 d s 4 19 iyhr ? (mn + 1) m 00 100 010 iylr ? (mn) m < n > < m > table 43. block transfer operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c block transfer search data (3) (2) cpd 11 101 101 s s 2 12 ar = (hl) m - - - - s 10 101 001 bc r -1 ? bc r hl r -1 ? hl r (3) (2) cpdr 11 101 101 s s 2 14 bc r 1 0 ar 1 (hl) m - - - - s 10 111 001 12 bc r = 0 or ar = (hl) m ar-(hl) r q bc r -1-bc r hl r -1 ? hl r repeat q until ar = (hl) m or bc r = 0 (3) (2) table 42. 16-bit load (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual 226 um005001-zmp0400 cpi 11101101 s s 2 12 ar-(hl) m - - - - s 10100001 bc r -1 ? bc r hl r + 1 ? hl r (3) (2) cpir 11101101 s s 2 14 bc r 1 0 ar*(hl) m - - - - s 10110001 12 bc r = 0 or ar = (hl) m ar-(hl) m q bc r -1 ? bc r hl r + 1 ? hl r repeat q until ar = (hl) m or bc r = 0 (2) ldd 11 101 101 s/d 2 12 (hl) m ? (de) m r - r 10 101 000 bc r -1 ? bc r de r -1 ? de r hl r -1 ? hl r lddr 11 101 101 s/d 2 14(bc r 1 0) (hl) m ? (de) m bc r -1 ? bc r q de r -1 ? de r hl r -1 ? hl r r r r 10 111 000 12(bc r = 0) repeat q until bc r = 0 (2) ldi 11 101 101 s/d 2 12 (hl) m ? de) r r - r 10 100 000 bc r -1 ? bc r de r + 1 ? de r hl r + 1 ? hl r ldir 11 101 101 s/d 2 14(bc r 1 0) (hl) m ? (de) m q bc r -1 ? bc r de r + 1 ? de r hl r + 1 ? hl r r r r 10 110 000 12(bc r = 0) repeat q until bc r = 0 (2)p/v = 0:bc r -1 = 0 p/v = 1:bc r -1 1 0 (3)z = 1:ar = (hl) m z = 0 :ar 1 ( hl) m table 43. block transfer (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 227 table 44. stock and exchange operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c push push zz 11zz 0101 s d 1 11 zzlr ? (sp-2) m zzhr ? (sp-1) m sp r -2 ? sp r push ix 11 011 101 s/d 2 14 ixlr ? (sp-2) m 11 100 101 ixhr ? (sp-1) m sp r -2 ? sp r push push iy 11 111 101 s/d 2 14 iylr ? (sp-2) m 11 100 101 iyhr ? (sp-1) m sp r -2 ? sp r pop pop zz 11 zz0 001 d s 1 9 (sp + 1) m ? xxhr(4) (sp)m ? zzlx sp r + 2 ? sp r pop ix 11 011 101 s/d 2 12 (sp + 1) m ? ixhr 11 100 001 (sp) m ? ixlr sp r + 2 ? sp r pop iy 11 111 101 s/d 2 12 (sp + 1) m ? iyhr 11 100 001 (sp) m -iylr sp r + 2 ? sp r
z8018x family mpu user manual 228 um005001-zmp0400 . exchange ex afaf? 00 001 000 s/d 1 4 af r -af r ' ex de, hl 11 101 011 s/d 1 3 de r -hl r ex x 11 011 001 s/d 1 3 bc r -bc r ' de r ? de r ' hl r ? hl r ' ex (sp),hl 11 100 011 s/d 1 16 hr ? (sp + 1) m lr ? (sp) m ex (sp),ix 11 011 101 s/d 2 19 ixhr ? (sp + 1) m ixlr-(sp) m ex (sp),iy 11 111 101 s/d 2 19 iyhr-(sp + 1) m 11 100 011 iylr ? (sp) m (4) in the case of pop af, flag is written as current contents of the stack table 44. stock and exchange (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 229 program and control instructions table 45. program control instructions operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c call call mn 11 001 101 d 3 16 pchr ? (sp-1) m < n > pclr ? (sp-2) m < m > mn ? pc r sp r -2 ? sp r call f,mn 11 f 100 d 3 6 (f : false) continue : f is false < n > 16 (f: true) call mn: f is true < m > jump djnzj 00 010 000 d 2 9 (br 1 0) br-1 ? br < j-2 > 2 7 (br = 0) continue: br = 0 pc r + j ? pc r : br 1 0 jp f,mn 11 f 010 d 3 6 (f: false) mn ? pc r : f is true < n > 3 9 (f: true) continue: f is false < m > jp mn 11 000 011 d 3 9 mn ? pc r < n > < m > jp (hl) 11 101 001 d 1 3 hl r ? pc r jp (ix) 11 011 101 d 2 6 ix r ? pc r 11 101 001 jp (iy) 11 111 101 d 2 6 iy r ? pc r 11 101 001 jr j 00 011 000 d 2 8 pc r + j ? pc r < j-2 > jr cj 00 111 000 d 2 6 continue: c = 0 < j-2 > 2 8 pc r + j ? pc r : c = 1 jr ncj 00 110 000 d 2 6 continue : c = 1 < j-2 > 2 8 pc r + j ? pc r : c = 0
z8018x family mpu user manual 230 um005001-zmp0400 jump jr zj 00 101 000 d 2 6 continue : z = 0 < j-2 > 2 8 pc r , + j ? pc r : z = 1 jr nzj 00 100 000 d 2 6 continue : z = 1 < j-2 > 2 8 pc r + j ? pc r : z = 0 return ret 11001001 d 1 9 (sp) m ? pclr (sp + 1) m ? pchr sp r + 2 ? sp r ret f 11f 000 d 1 5 (f : false) continue : f is false 1 10 (f : true) ret : f is true reti 11101101 d 2 12 (r0,r1) (sp) m ? pclr 01001101 zz(z) (sp + 1) m ? pchr sp r + 2 ? sp r retn 11101101 d 2 12 (sp) m ? pclr 01000101 (sp + 1) m ? pchr sp r + 2 ? sp r ief2 ? ief1 restart rst v 11 v 111 d 1 11 pchr ? (sp-1) m pclr ? (sp-2) m 0 ? pchr v ? pclr sp r -2 ? sp r table 45. program control instructions (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 231 table 46. i/o instructions operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c input in a,(m) 11 011 011 d s 2 9 (am)1, ? ar < m > m ? a0~a7 ar ? a8~a16 in g,(c) 11 101 101 d s 2 9 (bc)1 ? gr 01 g 000 g = 110 : only the - - r p r flags change cr ? a0~a7 br ? a8~16 in0 g,(m)** 11 101 101 d s 3 12 (00m)g ? gr - - r p r 00 g 000 g = 110 : only the flags change < m > m ? a0~a7 (00) ? a8~a16 (5) (6) ind 11 101 101 d s 2 12 (bc) m ? (hl) m x - x x - x 10 101 010 hl2 ? 1 ? hl2 br ? 1 ? br cr ? a0~a7 (6) indr 11 101 101 d s 2 14 (br 1 0) (bc)1 ? (hl) m qhl2 ? 1 ? hl8 br-1 ? br x s x x - x 10 111 010 12 (br = 0) repeat q until br = 0 cr ? a0~a7 br ? a8 ~ a16 (5) (6) ini 11 101 101 d s 2 12 (bc)1 ? (hl) m x - x x - x 10 100 010 hl r + 1 ? hl r br-1 ? br cr ? a0~a7 br ? a8~a16 (6)
z8018x family mpu user manual 232 um005001-zmp0400 input inir 11 101 101 d s 2 14 (br 1 0) (bc) i ? (hl) m q hl r + 1 ? hl r br-f ? br x s x x - x 10 110 010 12 (br = 0) repeat q until br = 0 cr ? a0~a7 br ? a8 ? a16 output out (m)a 11 010 011 s d 2 10 ar ? (am)1 < m > m ? a0~a7 ar ? a8~a16 out (c),g 11 101 101 s d 2 10 gr ? (bc)1 01 g 001 cr ? a0~a7 br ? a8~a16 out0(m),g** 11 101 101 s d 3 13 gr ? (00m)1 00 g 001 m ? a0~a7 < m > 00 ? a8~a16 (5) (6) otdm** 11 101 101 s d 2 14 (hl) m ? (00c)1 - - - p - - 10 001 011 hl r -1 ? hl r cr-1 ? cr br-1 ? br cr ? a0~a7 00? a8~a16 (6) otdmr** 11 101 101 s d 2 16 (br 1 0) (hl) m ? (00c)1 hl r -1-hl r qcr~1 ? cr br-1 ? br r s r s - r 10 011 011 14 (br = 0) repeat q until br = 0 cr ? a0~a7 00 ? a8~a16 (6) table 46. i/o instructions (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 233 output otdr 11 101 101 s d 2 14 (br 1 0) (hl) m ? (bc) m 1 qhl r -1 ? hl r br-1 b r x s x x - x 10 111 011 12 (br = 0) repeat q until br = 0 cr ? a0~a7 br ? a8~a16 q(hl) m ? (bc) m hl r + 1 ? hl r (5) (6) outi 11 101 101 s d 2 12 x - x x - x 10 100 011 br-1 ? br repeat q until br = 0 cr ? a0~a7 br ? a8~a16 (6) otir 11 101 101 s d 2 14 (br 1 0) (hl) m ? (bc) m qhl r + 1 ? hl r br-1 ? br x s x x - x 10 110 011 12 (br = 0) repeat q until br = 0 cr ? a0~a7 br ? a8~a16 tstiom** 11 101 101 s s 3 12 (00c)1*m - - s p r r 01 110 100 cr ? a0~a7 < m > 00 ? a8~a16 (5) (6) otim** 11 101 101 s d 2 14 (hl) m ? (00c) i - - - p - - 10 000 011 hl r + 1 ? hl r cr + 1 ? cr br-1 ? br cr ? a0~a7 00 ? a8~a16 (6) table 46. i/o instructions (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual 234 um005001-zmp0400 otimr** 11 101 101 s d 2 16 (br 1 0) (hl) m ? (00c) i hl r + 1 ? hl r qcr + 1 ? cr br-1 ? br r s r s - r 10 010 011 14 (br = 0) repeat q until br = 0 cr ? a0~a7 00 ? a8~a16 (5) (6) outd 11 101 101 s d 2 12 (hl) m ? (bc) 1 x - x x - x 10 101 011 hl r -1 ?h l r br-1 ? br cr ? a0~a7 br ? a8~a16 (5) z = 1 : br-1 = 0 z = 0 : br-1 1 0 (6) n = 1: msb of data = 1 n = 0 : msb of data = 0 table 46. i/o instructions (continued) operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c
z8018x family mpu user manual um005001-zmp0400 235 special control instructions table 47. special control instructions operation name mnemonics op code addressing bytes states operation flags 7 6 4 2 1 0 immed ext ind reg regi imp rel s z h p/v n c special function daa 00 100 111 s/d 1 4 decimal adjust accumulator - - - p - carry control ccf 00 111 111 1 3 c ? c r r - scf 00 110 111 1 3 1 ? c r r s cpu control di 11 110 011 1 3 0 ? ief1,0 ? ief2 (7) ei 11 111 011 1 3 1 ? ief1,1 ?i ef2 (7) halt 01 110 110 1 3 cpu halted im0 11 101 101 2 6 interrupt 01 000 110 mode 0 im1 11 101 101 2 6 interrupt 01 010 110 mode 1 im2 11 101 101 2 6 interrupt 01 011 110 mode 2 nop 00 000 000 1 3 no operation slp** 11 101 101 2 8 sleep 01 110 110 7) interrupts are not sampled at the end of di or ei.
z8018x family mpu user manual 236 um005001-zmp0400
z8018x family mpu user manual 237 um005001-zmp0400 instruction summary ** : added new instructions to z80 mnemonics bytes machine cycles states adc a,m 2 2 6 adc a,g 1 2 4 adc a, (hl) 1 2 6 adc a, (ix+d) 3 6 14 adc a, (iy+d) 3 6 14 add a,m 2 2 6 add a,g 1 2 4 add a, (hl) 1 2 6 add a, (ix+d) 3 6 14 add a, (iy+d) 3 6 14 adc hl,ww 2 6 10 add hl,ww 1 5 7 add ix,xx 2 6 10 add iy,yy 2 6 10 and m 2 2 6 and g 1 2 4 and (hl) 1 2 6 and (ix+d) 3 6 14 and (iy+d) 3 6 14 bit b, hu 2 3 9 bit b, (ix+d) 4 5 15 bit b, (iy+d) 4 5 15 bit b,g 2 2 6 call f,mn 3 2 6 (if condition is false)
z8018x family mpu user manual 238 um005001-zmp0400 3 6 16 (if condition is true) call mn 3 6 16 ccf 1 1 3 cpd 2 6 12 cpdr 2 8 14 (if bc r 1 0 and ar 1 (hl) m 2 6 12 (if bc r = 0 or ar = (hl) m cp (hl) 1 2 6 cpi 2 6 12 cpir 2 8 14 (if bc r 1 0 and ar 1 (hl) m 2 6 12 (if bcr = 0 or ar = (hl) m cp (ix+d) 3 6 14 cp (iy+d) 3 6 14 cpl 1 1 3 cp m 2 2 6 cp g 1 2 4 daa 1 2 4 dec (hl) 1 4 10 dec ix 2 3 7 dec iy 2 3 7 dec (ix+d) 3 8 18 dec (iy+d) 3 8 18 dec g 1 2 4 dec ww 1 2 4 di 1 1 3 djnz j 2 5 9 (if br 1 0) mnemonics bytes machine cycles states
z8018x family mpu user manual um005001-zmp0400 239 2 3 7 (if br = 0) ei 1 1 3 ex af,af' 1 2 4 ex de,hl 1 1 3 ex (sp),hl 1 6 16 ex (sp)i,ix 2 7 19 ex (sp),iy 2 7 19 exx 1 1 3 halt 1 1 3 im 0 2 2 6 im 1 2 2 6 im 2 2 2 6 inc g 1 2 4 inc (hl) 1 4 10 inc (ix+d) 3 8 18 inc (iy+d) 3 8 18 inc ww 1 2 4 inc ix 2 3 7 inc iy 2 3 7 in a,(m) 2 3 9 in g,(c) 2 3 9 ini 2 4 12 inir 2 6 14 (if br 1 0) 2 4 12 (if br = 0) ind 2 4 12 indr 2 6 14 (if br 1 0) indr 2 4 12 (if br = 0) in0 g,(m)** 3 4 12 jp f,mn 3 2 6 (if f is false) mnemonics bytes machine cycles states
z8018x family mpu user manual 240 um005001-zmp0400 3 3 9 (if f is true) jp (hl) 1 1 3 jp (ix) 2 2 6 jp (iy) 2 2 6 jp mn 3 3 9 jr j 2 4 8 jr c,j 2 2 6 (if condition is false) 2 4 8 (if condition is true) jr nc,j 2 2 6 (if condition is false) 2 4 8 (if condition is true) jr z,j 2 2 6 (if condition is false) 2 4 8 if condition is true) jr nz,j 2 2 6 (if condition is false) 2 4 8 (if condition is true) ld a, (bc) 1 2 6 ld a, (de) 1 2 6 ld a,i 2 2 6 ld a, (mn) 3 4 12 ld a,r 2 2 6 ld (bc),a 1 3 7 ldd 2 4 12 mnemonics bytes machine cycles states
z8018x family mpu user manual um005001-zmp0400 241 ld (de),a 1 3 7 ld ww,mn 3 3 9 ld ww,(mn) 4 6 18 lddr 2 6 14 (if bc r 1 0) 2 4 12 (if bc r = 0 ld (hl),m 2 3 9 ld hl,(mn) 3 5 15 ld (hl),g 1 3 7 ldi 2 4 12 ldi,a 2 2 6 ldir 2 6 14 (if bc r 1 0) 2 4 12 (if bc r = 0) ld ix,mn 4 4 12 lid ix,(mn) 4 6 18 ld (ix+d),m 4 5 15 ld (ix+ d),g 3 7 15 ld iy,mn 4 4 12 ld iy,(mn) 4 6 18 ld (iy+d),m 4 5 15 ld (iy+d),g 3 7 15 ld (mn),a 3 5 13 ld (mn),ww 4 7 19 ld (mn),hl 3 6 16 ld (mn),ix 4 7 19 ld (mn),iy 4 7 19 ld r,a 2 2 6 ld g,(hl) 1 2 6 ld g,(ix+d) 3 6 14 ld g,(iy+d) 3 6 14 ld g,m 2 2 6 mnemonics bytes machine cycles states
z8018x family mpu user manual 242 um005001-zmp0400 ld g,g' 1 2 4 ld sp,hl 1 2 4 ld sp,ix 2 3 7 ld sp,iy 2 3 7 mlt ww" 2 13 17 neg 2 2 6 nop 1 1 3 or (hl) 1 2 6 or (ix+d) 3 6 14 or (iy+d) 3 6 14 or m 2 2 6 or g 1 2 4 otdm** 2 6 14 otdmr** 2 8 16 (if br 1 0) 2 6 14 (if br = 0) otdr 2 6 14 (if br 1 0) 2 4 12 (if br = 0 otim** 2 6 14 otimr** 2 8 16 (if br 1 0) 2 6 14 (if br = 0) otir 2 6 14 (if br 1 0) 2 4 12 (if br = 0) outd 2 4 12 outi 2 4 12 out (m),a 2 4 10 out (c),g 2 4 10 out0 (m),g ** 3 5 13 pop ix 2 4 12 pop iy 2 4 12 pop zz 1 3 9 mnemonics bytes machine cycles states
z8018x family mpu user manual um005001-zmp0400 243 push ix 2 6 14 push iy 2 6 14 push zz 1 5 11 res b,(hl) 2 5 13 res b,(ix+d) 4 7 19 res b,(iy+d) 4 7 19 res b,g 2 3 7 ret 1 3 9 ret f 1 3 5 (if condition is false) 1 4 10 (if condition is true) reti 2 4 (r0, r1) 12 (r0, r1) 10 (z) 22 (z) retn 2 4 12 rla 1 1 3 rlca 1 1 3 rlc (hl) 2 5 13 rlc (ix-1-dl 4 7 19 rlc (iy+d) 4 7 19 rlc g 2 3 7 rld 2 8 16 rl (hl) 2 5 13 rl (ix+d) 4 7 19 rl (iy+d) 4 7 19 rl g 2 3 7 rra 1 1 3 rrca 1 1 3 rrc (hl) 2 5 13 rrc (ix+d) 4 7 19 mnemonics bytes machine cycles states
z8018x family mpu user manual 244 um005001-zmp0400 rrc (iy+d) 4 7 19 rrc g 2 3 7 rrd 2 8 16 rr (hl) 2 5 13 rr (ix+d) 4 7 19 rr (iy+d) 4 7 19 rr g 2 3 7 rst v 1 5 11 sbc a,(hl) 1 2 6 sbc a, (ix+d) 3 6 14 sbc a,(iy+d) 3 6 14 sbc a,m 2 2 6 sbc a,g 1 2 4 sbc hl,ww 2 6 10 scf 1 1 3 set b,(hl) 2 5 13 set b,(ix+d) 4 7 19 set b,(iy+d) 4 7 19 set b,g 2 3 7 sla (hl) 2 5 13 sla (ix+d) 4 7 19 sla (iy+d) 4 7 19 sla g 2 3 7 slp** 2 2 8 sra (hl) 2 5 13 sra (ix+d) 4 7 19 sra (iy+d) 4 7 19 sra g 2 3 7 srl (hl) 2 5 13 srl (ix+d) 4 7 19 mnemonics bytes machine cycles states
z8018x family mpu user manual um005001-zmp0400 245 srl (iy+d) 4 7 19 srl g 2 3 7 sub (hl) 1 2 6 sub (ix+d) 3 6 14 sub (iy+d) 3 6 14 sub m 2 2 6 sub g 1 2 4 **tstio m 3 4 12 **tst g 2 3 7 tst m** 3 3 9 tst (hl)** 2 4 10 xor (hl) 1 2 6 xor (ix+d) 3 6 14 xor (iy+d) 3 6 14 xor m 2 2 6 xor g 1 2 4 mnemonics bytes machine cycles states
z8018x family mpu user manual 246 um005001-zmp0400
z8018x family mpu user manual 247 um005001-zmp0400 op code map table 48. 1st op code map instruction format: xx ww (l0 = all) l0 = 0~7 bc de hl sp bc de hl af zz g (lo = 0~7) nz nc p0 p f b d h (hl) b d h (hl) 00h 10h 20h 30h v 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0 1 2 3 4 5 6 7 8 9 a b c d e f s ( h i = a l l ) b 0000 0 n0p djnzj jr nz,j jr nc,j ld g, s note 1) add a,s sub s and s or s ret f 0 c 0001 1 ld ww, mn pop zz 1 d 0010 2 ld (ww), a ld (mn) ,hl ld (mn), a jp f, mn 2 e 0011 3 inc ww jp mn out (m),a ex(sp), hl di 3 h 0100 4 inc g note1 call f, mn 4 l 0101 5 dec g note1 push zz 5 (hl) 0110 6 ld g,m note1 note2 halt note2 note2 note2 note2 add a,m sub m and m or m 6 a 0111 7 rlca rla daa scf rst v 7 b 1000 8 exaf,a f? jr j jr z,j jr c,j ld g, s adc a,s sbc a,s xor s cp s ret f 8 c 1001 9 add hl, ww ret exx jp(hl) ld sp, hl 9 d 1010 a ld a,(ww) ld hl, (mn) ld a, (mn) jp f, mn a e 1011 b dec ww table2 in a(m) exde,h l ei b h 1100 c inc g call f, mn c l 1101 d dec g call mn note3 table3 note3 d (hl) 1110 e ld g,m note2 note2 note2 note2 note2 adc a,m sbc a,m xor m cp m e a 1111 f rrca rra cpl ccf rst v f 0 1 2 3 4 5 6 7 8 9 a b c d e f c e l a c e l a z c pe m f g(l0 = 8~f) 08h 18h 28h 3bh v lo = 8~f lo hi
z8018x family mpu user manual 248 um005001-zmp0400 note 1: (hl) replaces g. note 2: (hl) replaces s. note 3: if ddh is supplemented as first op code for the instructions which have hl or (hl) as an operand in table48, the instructions are executed replacing hl with ix and (hl) with (ix+d). ex. 22h : ld (mn), hl ddh 22h : ld (mn), ix if fdh is supplemented as 1st op code for the instructions which have hl or (hl) as an operand in table48, the instructions are executed replacing hl with iy and (hl) with (iy+d). ex. 34h : inc (hl) fdh 34h : inc (iy+d) however, jp (hl) and ex de, hl are exceptions and note the following. ? if ddh is supplemented as 1st op code for jp (hl), (ix) replaces (hl) as operand and jp (ix) is executed ? if fdh is supplemented as 1st op code for jp (hl), (iy) replaces (hl) as operand and jp (iy) is executed ? even if ddh or fdh is supplemented as 1st op code for ex de, hl, hl is not replaced and the instruction is regarded as illegal instruction.
z8018x family mpu user manual um005001-zmp0400 249 table 49. 2nd op code map instruction format: cb xx b (l0 = 0~7) 0 2 4 6 0 2 4 6 0 2 4 6 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0 1 2 3 4 5 6 7 8 9 a b c d e f g ( h i = a l l ) b 0000 0 rlc g rl g sla g bit b,g res b,g set b,g 0 c 0001 1 1 d 0010 2 2 e 0011 3 3 h 0100 4 4 l 0101 5 5 (hl ) 0110 6 note 1) note 1) note 1) note1) note1) note1) 6 a 0111 7 7 b 1000 8 bit b,g res b,g set b,g 8 c 1001 9 rrc g rr g sra g srl g 9 d 1010 a a e 1011 b b h 1100 c c l 1101 d d (hl ) 1110 e note 1) note 1) note 1) note 1) note1) note1) note 1) e a 1111 f f 0 1 2 3 4 5 6 7 8 9 a b c d e f 1 3 5 7 1 3 5 7 1 3 5 7 b (lo = 8 ~ f) lo hi
z8018x family mpu user manual 250 um005001-zmp0400 table 50. 2nd op code map instruction format: ed xx ww (l0 = all) bc de hl sp g (l0 = 0~7) b d h b d h 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0 1 2 3 4 5 6 7 8 9 a b c d e f 0000 0 in0 g, (m) in g, (c) ldi ldir 0 0001 1 out0 (m),g out (c),g cpi cpir 1 0010 2 sbc hl, ww ini inir 2 0011 3 ld (mn), ww otim otim r outi otir 3 0100 4 tst g tst (hl) neg tst m tstio m 4 0101 5 retn 5 0110 6 im 0 im 1 slp 6 0111 7 ld i,a ld a,i rrd 7 1000 8 in0 g, (m) in g, (c) ldd lddr 8 1001 9 out0 (m), g out (c) , g cpd cpdr 9 1010 a adc hl,ww ind indr a 1011 b ld ww, (mn) otd m otd mr outd otdr b 1100 c tst g mlt ww c 1101 d reti d 1110 e im 2 e 1111 f ldr, a ld a,r rld f 0 1 2 3 4 5 6 7 8 9 a b c d e f c e l a c e l a g (l0 = 8~f) lo hi
z8018x family mpu user manual 251 um005001-zmp0400 bus control signal conditions bus and control signal condition in each machine cycle * (address) invalid z (data) high impedance. ** added new instructions to z80 table 51. bus and control signal condition in each machine cycle instruction machine cycle states address data rd wr mreq iorq m1 halt st add hl,ww mc1 t1t2t3 1st op code address 1st op code 0 1 0 1 0 1 0 mc2 ~mc5 titititi * z 1 1 1 1 1 1 1 add ix,xx add iy,yy mc1 t1t2t3 1st op code address 1st op code 0 1 0 1 0 1 0 mc2 t1t2t3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc3 ~mc6 titititi * z 1 1 1 1 1 1 1 adc hl,ww sbc hl,ww mc1 t1t2t3 1st op code address 1st op code 0 1 0 1 0 1 0 mc2 t1t2t3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc3 ~mc6 titititi * z 1 1 1 1 1 1 1
z8018x family mpu user manual 252 um005001-zmp0400 add a,g adc a,g sub g sbc a,g and g or g xor g cp g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 add a,m adc a,m sub m sbc a,m and m or m xor m cp m mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 add a, (hl) adc a, (hl) sub (hl) sbc a, (hl) and hu or (hl) xor (hl) cp (hl) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 add a, (ix+ d) add a, (iy+d) adc a, (ix+d) adc a, (iy+d) sub (lx+d) sub (iy+d) sbc a, (ix+ d) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 sbc a, (iy+ d) and (ix+d) mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 253 and (iy+ d) or (ix + d) or (iy+d) xor (ix + d) xor (iy+d) mc 4 ~mc 6 t i titi * z 1 1 1 1 1 1 1 cp (ix+d) cp (iy+d) mc 6 t 1 t 2 t 3 ix+d iy+d data 0 1 0 1 1 1 1 bit b,g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 bit b, (hl) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 bit b, (ix+d) bit b, (iy+d) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 3rd op code address 3rd op code 0 1 0 1 0 1 1 mc 5 t 1 t 2 t 3 ix+ d iy+d data 0 1 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 254 um005001-zmp0400 call mn mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 1 mc 6 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1 call f,mn (if condition is false) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 call f,mn if condition is true) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 1 mc 6 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1 ccf mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 255 cpi cpd mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 ~mc 6 t i t i t i * z 1 1 1 1 1 1 1 cpir cpdr (if bc r 1 0 and ar = (hl) m ) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 ~m c 8 t i t i t i ti t i * z 1 1 1 1 1 1 1 cpir cpdr (if bc r =0 or ar=(hl) m ) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 ~m c 6 t i t i t i * z 1 1 1 1 1 1 1 cpl mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 daa mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 di*1 mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 * 1 interrupt request is not sampled. table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 256 um005001-zmp0400 djnz j (if br 1 0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i *2 * z 1 1 1 1 1 1 1 mc 3 t 1 t 2 t 3 1st operand address j-2 0 1 0 1 1 1 1 mc 4 ~m c 5 t i t i * z 1 1 1 1 1 1 1 djnz j (if br=0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i *1 * z 1 1 1 1 1 1 1 mc 3 t 1 t 2 t 3 1st operand address j-2 0 1 0 1 1 1 1 ei*3 mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 ex de, hl exx mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 ex af, af? mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 ex (sp), hl mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 sp data 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 sp+1 data 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 sp+1 h 1 0 0 1 1 1 1 mc 6 t 1 t 2 t 3 sp l 1 0 0 1 1 1 1 *2 dma,refresh, or bus release cannot be executed after this state. (request is ignored) *3 interrupt request is not sampled. table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 257 ex (sp),ix ex (sp),iy mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 sp data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 sp+1 data 0 1 0 1 1 1 1 mc 5 t i * z 1 1 1 1 1 1 1 mc 6 t 1 t 2 t 3 sp+1 ixh iyh 1 0 0 1 1 1 1 mc7 t 1 t 2 t 3 sp ixl iyl 1 0 0 1 1 1 1 halt mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 ? ? next op code address next op code 0 1 0 1 0 0 0 im0 im1 im2 mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 inc g dec g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 inc (hl) dec (hl) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 3 ti * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 258 um005001-zmp0400 inc (ix+ d) inc (iy+d) dec (ix+d) dec (iy+d) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 mc 4 ~m c 5 t i t i * z 1 1 1 1 1 1 1 mc 6 t 1 t 2 t 3 x+ d iy+ d data 0 1 0 1 1 1 1 mc7 t 1 * z 1 1 1 1 1 1 1 mc8 t 1 t 2 t 3 ix+ d iy+d data 1 0 0 1 1 1 1 inc ww dec ww mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 t 1 1 1 1 inc ix inc iy dec ix dec iy mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 ti * z 1 1 1 1 1 1 1 in a,(m) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 m to a0~a7 a to a8~a15 data 0 1 1 0 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 259 in g,(c) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 bc data 0 1 1 0 1 1 1 ino g,(m)** mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 m to a0~a7 00h to a8~a15 data 0 1 1 0 1 1 1 ini ind mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 bc data 0 1 1 0 1 1 1 mc 4 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 inir indr (if br 1 0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 bc data 0 1 1 0 1 1 1 mc 4 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 mc 5 ~m c 6 t i t i * z 1 1 1 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 260 um005001-zmp0400 inir indr (if br=0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 bc data 0 1 1 0 1 1 1 mc 4 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 jp mn mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 jp f,mn (if is false) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 jp f,mn (if f is true) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 jp (hl) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 jp (ix) jp (iy) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 261 jr j mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address j-2 0 1 0 1 1 1 1 mc 3 ~m c 4 t i t i * z 1 1 1 1 1 1 1 jr c,j jr nc,j jr z,j jr nz,j (if condition is false) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address j-2 0 1 0 1 1 1 1 jr c,j jr nc,j jr z,j jr nz,j (if condition is true) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address j-2 0 1 0 1 1 1 1 mc 3 ~m c 4 t i t i * z 1 1 1 1 1 1 1 ld g,g' mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 ld g,m mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 ld g, (hl) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 262 um005001-zmp0400 ld g, (ix+d) ld g, (iy+d) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 mc 4 ~m c 5 t i t i * z 1 1 1 1 1 1 1 mc 6 t 1 t 2 t 3 ix+d iy+d data 0 1 0 1 1 1 1 ld (hl),g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 mc 3 t 1 t 2 t 3 hl g 1 0 0 1 1 1 1 ld (ix + d),g ld (iy + d),g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 mc 4 ~ mc 6 t i t i t i * z 1 1 1 1 1 1 1 mc7 t 1 t 2 t 3 ix+d iy+d g 1 0 0 1 1 1 1 ld (hl),m mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 263 ld (ix+d),m ld (iy+d),m mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 5 t 1 t 2 t 3 ix+ d iy+d data 1 0 0 1 1 1 1 ld a, (bc) ld a, (de) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 bc de data 0 1 0 1 1 1 1 ld a,(mn) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 mn data 0 1 0 1 1 1 1 ld (bc),a ld (de),a mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc2 t i * z 1 1 1 1 1 1 1 mc 3 t 1 t 2 t 3 bc de a 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 264 um005001-zmp0400 ld (mn),a mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 mn a 1 0 0 1 1 1 1 ld a,i ld a,r ld i,a ld r,a mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 ld ww, mn mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 ld ix,mn ld iy,mn mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 *4 in the case of r1 and z mask, interrupt request is not sampled. table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st *4
z8018x family mpu user manual um005001-zmp0400 265 ld hl, (mn) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 mn data 0 1 0 1 1 1 1 mc 5 t 1 t 2 t 3 mn+1 data 0 1 0 1 1 1 1 ld ww,(mn) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 5 t 1 t 2 t 3 mn data 0 1 0 1 1 1 1 mc 6 t 1 t 2 t 3 mn+ 1 data 0 1 0 1 1 1 1 ld ix,(mn) ld iy,(mn) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 5 t 1 t 2 t 3 mn data 0 1 0 1 1 1 1 mc 6 t 1 t 2 t 3 mn+1 data 0 1 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 266 um005001-zmp0400 ld (mn),hl mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 mn l 1 0 0 1 1 1 1 mc 6 t 1 t 2 t 3 mn+1 h 1 0 0 1 1 1 1 ld (mn),ww mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 5 t i * z 1 1 1 1 1 1 1 mc 6 t 1 t 2 t 3 mn wwl 1 0 0 1 1 1 1 mc7 t 1 t 2 t 3 mn+1 wwh 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 267 ld (mn),ix ld (mn),iy mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address n 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 2nd operand address m 0 1 0 1 1 1 1 mc 5 t i * z 1 1 1 1 1 1 1 mc 6 t 1 t 2 t 3 mn ixl iyl 1 0 0 1 1 1 1 mc7 t 1 t 2 t 3 mn+1 ixh iyh 1 0 0 1 1 1 1 ld sp, hl mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 ld sp,ix ld sp,iy mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 ldi ldd mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 de data 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 268 um005001-zmp0400 ldir lddr (if bcr 1 0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 de data 1 0 0 1 1 1 1 mc 5 ~m c 6 t i t i * z 1 1 1 1 1 1 1 ldir lddr (if bcr=0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 de data 1 0 0 1 1 1 1 mlt ww** mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 ~mc 13 t i t i tt i t i t i t i t i t i t i t i * z 1 1 1 1 1 1 1 neg mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 nop mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 269 out (m),a mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 mc 3 t i * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 m to a0~a7 a to a8~a15 a 1 0 1 0 1 1 1 out (c),g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 bc g 1 0 1 0 1 1 1 out0 (m),g** mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 m to a0~a7 00h to a8~a15 g 1 0 1 0 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 270 um005001-zmp0400 otim** otdm** mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 5 t 1 t 2 t 3 c to a0~a7 00h to a8~a15 data 1 0 1 0 1 1 1 mc 6 t i * z 1 1 1 1 1 1 1 otimr** otdmr** (if br 1 0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 5 t 1 t 2 t 3 c to a0~a7 00h to a8~a15 data 1 0 1 0 1 1 1 mc 6 ~m c8 t i t i t i * z 1 1 1 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 271 otimr** otdmr** (if br= 0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 5 t 1 t 2 t 3 c to a0~a7 00h to a8~a15 data 1 0 1 0 1 1 1 mc 6 t i * z 1 1 1 1 1 1 1 outi outd mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 bc data 1 0 1 0 1 1 1 otir otdr (if br` 1 0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 bc data 1 0 1 0 1 1 1 mc 5 ~m c 6 t i t i * z 1 1 1 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 272 um005001-zmp0400 otir otdr (if br=0) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc4 t 1 t 2 t 3 bc data 1 0 1 0 1 1 1 pop zz mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 sp data 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 sp+1 data 0 1 0 1 1 1 1 pop ix pop iy mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 sp data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 sp+1 data 0 1 0 1 1 1 1 push zz mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 ~mc 3 t i t i * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 sp-1 zzh 1 0 0 1 1 1 1 mc5 t 1 t 2 t 3 sp-2 zzl 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 273 push ix push iy mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 ~m c 4 t i t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 sp-1 ixh iyh 1 0 0 1 1 1 1 mc 6 t 1 t 2 t 3 sp-2 ixl iyl 1 0 0 1 1 1 1 ret mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 sp data 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 sp+1 data 0 1 0 1 1 1 1 ret f (if condition is false) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 ~m c 3 t i t i * z 1 1 1 1 1 1 1 ret f (if condition is true) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 mc 3 t 1 t 2 t 3 sp data 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 sp+1 data 0 1 0 1 1 1 1 reti (r0, r1) retn mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 sp data 0 1 0 1 1 0 1 mc 4 t 1 t 2 t 3 sp+1 data 0 1 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 274 um005001-zmp0400 reti (z) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0*5 1 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0*5 1 1 1 mc 3 ~mc 5 t i t i t i * z 1 1 1 1 1*5 1 1 1 mc 6 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0*5 0 1 1 mc7 t i * z 1 1 1 1 1*5 1 1 1 mc8 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0*5 0 1 1 mc9 t 1 t 2 t 3 sp data 0 1 0 1 1*5 1 1 1 mc 1 0 t 1 t 2 t 3 sp+1 data 0 1 0 1 1*5 1 1 1 rlca rla rrca rra mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 rlc g rl g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 rrc g rr g sla g sra g srl g mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 *5 the upper and lower data show the state of m1 when ioc = 1 and ioc = 0 respectively. table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 275 rlc (hl) rl (hl) rrc (hl) rr (hl) sla (hl) sra (hl) srl (hl) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 rlc (ix + d) rlc (iy + d) rl (ix + d) rl (iy + d) rrc (ix + d) rrc (iy + d) rr (ix + d) rr (iy + d) sla (ix + d) sla (iy + d) sra (ix + d) sra (iy + d) srl (ix + d) srl (iy + d) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2ndop code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 3rd op code address 3rd op code 0 1 0 1 0 1 1 mc 5 t 1 t 2 t 3 ix+d iy+d data 0 1 0 1 1 1 1 mc 6 t i * z 1 1 1 1 1 1 1 mc7 t 1 t 2 t 3 ix+d iy+d data 1 0 0 1 1 1 1 rld rrd mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 ~m c7 t i t i t i t i * z 1 1 1 1 1 1 1 mc8 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 276 um005001-zmp0400 rst v mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 ~mc 3 t i t i * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 1 mc 5 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1 scf mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 set b,g res b,g mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 set b. (hl) res b, (hl) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2ndop code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 hl data 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 hl data 1 0 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 277 set b, (ix+d) set b, (iy+d) res b, (ix+d) res b, (iy+d) mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address d 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 3rd op code address 3rd op code 0 1 0 1 0 1 1 mc 5 t 1 t 2 t 3 ix+d iy+d data 0 1 0 1 1 1 1 mc 6 t i * z 1 1 1 1 1 1 1 mc7 t 1 t 2 t 3 ix+ d iy+d data 1 0 0 1 1 1 1 slp** mc 1 t 1 t 2 t 3 1st op code address 1stop code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 ? ? 7ffffh z 1 1 1 1 1 0 1 tstio m** mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 mc 4 t 1 t 2 t 3 c to a0~a7 00h to a8~a15 data 0 1 1 0 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual 278 um005001-zmp0400 tst g** mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t i * z 1 1 1 1 1 1 1 tst m** mc 1 t 1 t 2 t 3 1st op code address 1st op code 0 1 0 1 0 1 0 mc 2 t 1 t 2 t 3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc 3 t 1 t 2 t 3 1st operand address m 0 1 0 1 1 1 1 tst (hl)** mc1 t1t2t3 1st op code address 1st op code 0 2 0 2 0 2 0 mc2 t1t2t3 2nd op code address 2nd op code 0 1 0 1 0 1 1 mc3 ti * z 1 1 1 1 1 1 1 mc4 t1t23 hl data 0 1 0 1 1 1 1 table 51. bus and control signal condition in each machine cycle (continued) instruction machine cycle states address data rd wr mreq iorq m1 halt st
z8018x family mpu user manual um005001-zmp0400 279 interrupts table 52. interrupts instruction machine cycle states address data rd wr mreq i orq m1 halt st nmi mc 1 t 1 t 2 t 3 next op code address (pc) 0 1 0 1 0 1 0 mc 2 ~mc 3 t 1 t 1 * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 1 mc 5 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1 int0 mode 0 (rst inserted) mc 1 t 1 t 2 tw twt 3 next op code address 1st (pc) op code 1 1 1 0 0 1 0 mc 2 ~mc 3 t 1 t 1 * z 1 1 1 1 1 1 1 mc 4 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 1 mc 5 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1 int0 mode 0 (call inserted) mc 1 t 1 t 2 tw twt 3 next op code address (pc) 1st op code 1 1 1 0 0 1 0 mc 2 t 1 t 2 t 3 pc n 0 1 0 1 1 1 1 mc 3 t 1 t 2 t 3 pc+1 m 0 1 0 1 1 1 1 mc 4 t i * z 1 1 1 1 1 1 1 mc 5 t 1 t 2 t 3 sp-1 pc+2(h) 1 0 0 1 1 1 1 mc 6 t 1 t 2 t 3 sp-2 pc+2(l) 1 0 0 1 1 1 1 int 0 mode 1 mc 1 t 1 t 2 tw twt 3 next op code address (pc) 1 1 1 0 0 1 0 mc 2 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 1 mc 3 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1
z8018x family mpu user manual 280 um005001-zmp0400 int0 mode 2 mc 1 t 1 t 2 tw twt 3 next op code address (pc) vector 1 1 1 0 0 1 0 mc 2 t i * z 1 1 1 1 1 1 1 mc 3 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 mc 4 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1 mc 5 t 1 t 2 t 3 i, vector data 0 1 0 1 1 1 1 mc 6 t 1 t 2 t 3 t 1 t 2 ,tw i, vector+1 data 0 1 0 1 1 1 1 int1 int2 internal interrupts mc 1 t 1 t 2 ,tw twt 3 next op code address (pc) 1 1 1 1 1 1 0 mc 2 t i * z 1 1 1 1 1 1 1 mc 3 t 1 t 2 t 3 sp-1 pch 1 0 0 1 1 1 1 mc 4 t 1 t 2 t 3 sp-2 pcl 1 0 0 1 1 1 1 mc 5 t 1 t 2 t 3 i, vector data 0 1 0 1 1 1 1 mc 6 t 1 t 2 t 3 i, vector+1 data 0 1 0 1 1 1 1 table 52. interrupts (continued) instruction machine cycle states address data rd wr mreq i orq m1 halt st
z8018x family mpu user manual 281 um005001-zmp0400 operating modes summary request acceptances in each operating mode table 53. request acceptances in each operating mode current status request normal operation (cpu mode and iostop mode) wait state refresh cycle interrupt acknowledge cycle dma cycle bus release mode sleep mode system stop mode wait acceptable acceptable not acceptable acceptable acceptable not acceptable not acceptable not acceptable refresh request request of refresh by the on-chip refresh controller refresh cycle begins at the end of machine cycle (mc) not acceptable not acceptable refresh cycle begins at the end mc refresh cycle begins at the end of mc not acceptable not acceptable not acceptable dreq0 dreq1 dma cycle begins at the end of mc dma cycle begins at the end of mc acceptable refresh cycle precedes. dma cycle begins at the end of one mc acceptable dma cycle begins at the end of mc. acceptable refer to ?dma controller? for details. acceptable *after bus release cycle, dma cycle begins at the end of one mc not acceptable not acceptable busreq bus is released at the end of mc not acceptable not acceptable bus is released at the end of mc bus is released at the end of mc continue bus release mode acceptable acceptable interrupt int0, int1, 1nt2 accepted after executing the current instruction. accepted after executing the current instruction not acceptable not acceptable not acceptable not acceptable acceptable return from sleep mode to normal operation. acceptable return from system stop mode to normal operation
z8018x family mpu user manual 282 um005001-zmp0400 request priority the z80180 features three types of requests. . type 1, type 2, and type 3 requests priority as follows. ? highest priority type 1 > type 2 > type 3 lowest priority ? each request priority in type 2 is shown as follows. highest priority bus req. > refresh req. > dma request lowest priority internal i/o interrupt - - - - - - - not acceptable nmi - - - not acceptable interrupt acknowledge cycle precedes. nmi is accepted after executing acceptable dma cycle stops acceptable return from system stop mode to normal operation note: * not acceptable when dma request is in level-sense. - : same as above. mc: machine cycle table 54. the z80180 types of requests type 1 accepted in specified state wait type 2 accepted in each machine cycle refresh request, dma request, and bus request. type 3 accepted in each instruction interrupt request table 53. request acceptances in each operating mode current status request normal operation (cpu mode and iostop mode) wait state refresh cycle interrupt acknowledge cycle dma cycle bus release mode sleep mode system stop mode
z8018x family mpu user manual um005001-zmp0400 283 note: if bus request and refresh request occur simultaneously, bus request is accepted but refresh request is cleared. operation mode transition normal *1 halt sleep iostop system stop reset i o s t o p = 1 i o s t o p = 0 reset = 0 r e s e t = 0 r e s e t = 0 r e s e t = 0 r e s e t = 0 r e s e t = 0 h a l t i n s t r u c t i o n i n t e r r u p t s l p i n s t r u c t i o n i n t e r r u p t s l p i n s t r u c t i o n i n t e r r u p t
z8018x family mpu user manual 284 um005001-zmp0400 figure 94. operation mode transition * 1. normal: cpu executes instructions normally in normal mode. * 2. dma request: dma is requested in the following cases. ? dreq0 , dreq1 = 0 memory to/from (memory mapped) i/0 dma transfer ? b. deo = 1 (memory to/from memory dma transfer) * 3. dma end: dma ends in the following cases: dma normal *1 reset refresh bus release b u s r e q = 0 b u s r e q = 1 b u s r e q = 0 b u s r e q = 1 reset = 0 r e s e t = 0 r e s e t = 1 r e s e t = 0 r e s e t = 0 d m a r e q u e s t * 2 e n d o f d m a * 3 r e f r e s h r e q u e s t e n d o f r e f r e s h e n d o f r e f r e s h r e f r e s h r e q u e s t
z8018x family mpu user manual um005001-zmp0400 285 ? dreq0 , dreq1 = 1 memory to/from (memory mapped) i/o dma transfer ? bcr0, bcr1 = 0000h (all dma transfers) ? nmi = 0 (all dma transfers) other operation mode transitions the following operation mode transitions are also possible. 1. halt dma refresh bus release iostop dma refresh bus release 2. sleep bus release system stop bus release { } { }
z8018x family mpu user manual 286 um005001-zmp0400
z8018x family mpu user manual 287 um005001-zmp0400 status signals pin outputs in each operating mode table55 describes pin outputs in each operating mode. table 55. pin outputs in each operating mode mode m1 mreq iorq rd wr rfsh halt busack st address bus data bus cpu operation op code fetch (1st op code) 0 0 1 0 1 1 1 1 0 a in op code fetch (except 1 st op code) 0 0 1 0 1 1 1 1 1 a in memread 1 0 1 0 1 1 1 1 1 a in memory write 1 0 1 1 0 1 1 1 1 a out i/o read 1 1 0 0 1 1 1 1 1 a in i/o write 1 1 0 1 0 1 1 1 1 a out internal operation 1 1 1 1 1 1 1 1 1 a in refresh 1 0 1 1 1 0 1 1 * a in interrupt acknowledge cycle (1st machine cycle) nmi 0 0 1 0 1 1 1 1 0 a in int0 0 1 0 1 1 1 1 1 0 a in int1, int2 & internal interrupts 1 1 1 1 1 1 1 1 0 a in bus release 1 z z z z 1 1 0 * z in halt 0 0 1 0 1 1 0 1 0 a in sleep 1 1 1 1 1 1 0 1 1 1 in
z8018x family mpu user manual 288 um005001-zmp0400 ? 1 : high ? 0 : low ? a : programmable ? z : high impedance ? in : input ? out : output ? * : invalid pin status tables56 describes the status of each ping during reset and low power operation modes. internal dma memory read 1 0 1 0 1 1 * 1 0 a in memory write 1 0 1 1 0 1 * 1 0 a out i/o read 1 1 0 0 1 1 * 1 0 a in i/o write 1 1 0 1 0 1 * 1 0 a out reset 1 1 1 1 1 1 1 1 1 z in table 55. pin outputs in each operating mode (continued) mode m1 mreq iorq rd wr rfsh halt busack st address bus data bus
z8018x family mpu user manual um005001-zmp0400 289 table 56. pin status during reset and low power operation modes symbol pin function pin status in each operation mode reset sleep iostop system stop wait ? in (n) in (n) in (a) in (n) busack ? 1 out out out busreq ? in (n) in (a) in (a) in (a) reset ? 0 in (a) in (a) in (a) nmi ? in (n) in (a) in (a) in (a) int 0 ? in (n) in (a) in (a) in (a) int 1 ? in (n) in (a) in (a) in (a) int 2 ? in (n) in (a) in (a) in (a) st ? 1 1 out 1 a0 ? a17, a19 ? z 1 a 1 a18/tout a18 z 1 a 1 tout z out h h d0 ? d7 ? z z a z rts 0 ? 1 h out h cts 0 ? in (n) in (a) in (n) n (n) dcd 0 ? in (n) in (a) in (n) in (n) txa0 ? 1 out h h rxa0 ? in (n) in (a) in (n) in (n) cka0/ dreq 0 cka0 (internal clock mode) z out z z
z8018x family mpu user manual 290 um005001-zmp0400 cka0 (external clock mode) z in (a) in (n) in (n) dreq0 z in (n) in (a) in (n) txa1 ? 1 out h h rxa1 ? in (n) in (a) in (n) in (n) cka1/ tend 0 cka1 (internal clock mode) z out z z cka1 (external clock mode) z in (a) in (n) in (n) tend 0 z 1 out 1 txs ? 1 out h h rxs/ cts 1 rxs in (n) in (a) in (n) in (n) cts1 in (n) in (a) in (n) in (n) cks cks (internal clock mode) z out 1 1 cks (external clock mode) z in (a) z z dreq 1 ? in (n) in (n) in (a) in (n) tend 1 ? 1 1 out 1 halt ? 1 0 out 0 rfsh ? 1 1 out 1 iorq ? 1 1 out 1 table 56. pin status during reset and low power operation modes (continued) symbol pin function pin status in each operation mode reset sleep iostop system stop
z8018x family mpu user manual um005001-zmp0400 291 ? 1: high 0: low a: programmable z: high impedance ? in (a): input (active) in (n): input (not active) out: output ? h: holds the previous state ? ? : same as the left mreq ? 1 1 out 1 e ? 0 e clock output ? ? m1 ? 1 1 out 1 wr ? 1 1 out 1 rd ? 1 1 out 1 phi ? phi clock output ? ? ? table 56. pin status during reset and low power operation modes (continued) symbol pin function pin status in each operation mode reset sleep iostop system stop
z8018x family mpu user manual 292 um005001-zmp0400
z8018x family mpu user manual 293 um005001-zmp0400 i/o registers internal i/o registers by programming ioa7 and ioa6 as the i/o control register, internal i/o register addresses are relocatable within ranges from 0000h to 00ffh in the i/o address space. table 57. internal i/o registers register mnemonics address remarks asci control register a channel 0: cntla0 0 0 asci control register a channel 1: cntla1 0 1 mpe re te rts0 mpbr/ efr mod2 mod1 mod0 r/w r/w r/w r/w r/w r/w r/w r/w mode selection multi processor bit receive/ error flag reset request to send transmit enable receive enable multi processor enable invalid 0 1 0 0 0 0 0 1 bit during reset r/w r/w r/w r/w r/w r/w r/w r/w r/w mode selection multi processor bit receive/ error flag reset 0 0 1 0 0 0 0 mpe re te mod2 mod1 mod0 cka1d mpbr/ efr invalid transmit enable receive enable multi processor enable cka1 disable mod 2 1 0 0 0 0 start + 7 bit data + 1 stop 0 0 1 start + 7 bit data + 2 stop 0 1 0 start + 7 bit data + parity + 1 stop 0 1 1 start + 7 bit data + parity + 2 stop 1 0 0 start + 8 bit data + 1 stop 1 0 1 start + 8 bit data + 2 stop 1 1 0 start + 8 bit data + parity + 1 stop 1 1 1 start + 8 bit data + parity + 2 stop bit during reset r/w
z8018x family mpu user manual 294 um005001-zmp0400 asci control register b channel 0: cntlb0 0 2 asci control register b channel 1: cntlb1 0 3 table 57. internal i/o registers (continued) register mnemonics address remarks mpbt mp cts / ps peo dr ss2 ss1 ss0 bit during reset r/w 0 0 0 * 1 1 1 r/w r/w r/w r/w r/w r/w r/w r/w clock source and speed select divide ratio parity even or odd clear to send/prescale multi processor multi processor bit transmit * cts : depending on the condition 0f cts pin. ps: cleared to 0. invalid mpbt mp cts / peo dr ss2 ss1 ss0 r/w r/w r/w r/w r/w r/w r/w r/w clock source and divide ratio clear to send/prescale multi processor multi processor bit transmit 0 invalid 0 0 0 1 1 1 bit during reset r/w ps speed select parity even or odd general divide ratio ps=0 (divide ratio=10) ps=1 (divide ratio=30) ss2 1 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 f ? 160 ? ? ? ? ? ? f ? ? ? ? ? ? ? 320 10240 5120 2560 1280 640 f ? 640 ? ? ? ? ? ? 1280 2560 5120 10240 20480 40960 f ? 480 ? ? ? ? ? ? 960 1920 3840 7680 15360 30720 1920 3840 7680 15360 30720 61440 122880 external clock (frequency < f ? 40) dr=0 (x 16) dr=1 (x 64) dr=0 (x 16) dr=1 (x 64)
z8018x family mpu user manual um005001-zmp0400 295 asci status channel 0: stat0 0 4 asci status channel 1: stat1 0 5 table 57. internal i/o registers (continued) register mnemonics address remarks r r r r r/w r r r/w transmit interrupt enable 0 0 0 0 * ** 0 rdrf ovrn pe dcd0 tdre tie fe invalid bit during reset r/w rie transmit data register empty data carrier detect receive interrupt enable framing error parity error overrun error receive data register full tdre l h 1 0 ** cts 0 pin * dcd 0 : depending on the condition of dcd 0 pin. r r r r r/w r r r/w transmit interrupt enable 0 0 0 0 0 1 0 rdrf ovrn pe cts1e tdre tie fe 0 bit during reset r/w rie transmit data register empty cts1 enable receive interrupt enable framing error parity error overrun error receive data register full
z8018x family mpu user manual 296 um005001-zmp0400 asci transmit data register channel 0: asci transmit data register channel 1: asci receive data register channel 0: asci receive data register channel 1: csi/o control register: tdr0 tdr1 tsr0 tsr1 cntr 0 6 0 7 0 8 0 9 0 a table 57. internal i/o registers (continued) register mnemonics address remarks ef eie te ? ss2 ss1 ss0 r r/w r/w r/w r/w r/w r/w receive enable end interrupt enable end flag 1 0 0 0 0 1 1 1 bit during reset r/w speed select transmit enable re ss2 1 0 0 0 0 0 0 1 0 1 0 0 1 1 phi ? 20 ? ? ? 40 160 80 external baud rate ss2 1 0 1 0 0 1 0 1 1 1 0 1 1 1 phi ? 320 ? ? 640 1280 baud rate frequency < ? 20)
z8018x family mpu user manual um005001-zmp0400 297 csi/o transmit/ receive data register: timer data register channel 0l: timer data register channel 0h: timer reload register channel 0l: timer reload register channel 0h: timer control register channel 0l: trdr tmdr0l tmdr0h rldr0l rldr0h tcr 0 b 0 c 0 d 0 e 0 f 1 0 table 57. internal i/o registers (continued) register mnemonics address remarks r r r/w r/w r/w r/w r/w r/w 0 0 0 0 0 0 0 tf1 tf0 te1 toc0 tde1 tde0 te0 0 bit during reset r/w toc1 a 18 /tout 0 0 inhibited toc1,0 timer down count enable 1,0 timer output control 1,0 timer interrupt enable 1,0 timer interrupt flag 1,0 toggle 0 1 0 1 1 0 1 1
z8018x family mpu user manual 298 um005001-zmp0400 timer data register channel 1l: timer data register channel 1h: timer reload register channel 1l timer reload register channel 1h: free running counter: dma source address register channel 0l: dma source address register channel 0h: dma source address register channel 0b: dma destination address register channel 0l: dma destination address register channel 0h: dma destination address register channel 0b: dma byte count register channel 0l: dma byte count register channel 0h: dma memory address register channel 1l: dma memory address register channel 1h: tmdr1l tmdr1h rldr1l rldr1h frc sar0l sar0h sar0b dar0l dar0h dar0b bcrol bcroh mar1l mar1h 1 4 1 5 16 1 7 1 8 2 0 2 1 2 2 2 3 2 4 2 5 26 2 7 2 8 2 9 table 57. internal i/o registers (continued) register mnemonics address remarks bits 0-2 (3) are used for sar0b a 19 *, a 18 , a 17 , a 16 x x x x x x x x 0 0 1 1 0 1 0 1 dma transfer request dreq 0 (external) rdr0 (asci0) rdr1 (asci1) not used bits 0-2 (3) are used for dar0b a 19 *, a 18 , a 17 , a 16 x x x x x x x x 0 0 1 1 0 1 0 1 dma transfer request dreq 0 (external) tdr0 (asci0) tdr1 (asci1) not used * in the r1 and z mask, these dmac registers are expanded from 4 bits to 3 bits in the package version of cp-68. read only
z8018x family mpu user manual um005001-zmp0400 299 dma memory address register channel 1b: dma i/o address register channel 1l: dma i/o address register channel 1h dma byte count register channel 1l: dma byte count register channel 1h: dma status register: dma mode register: mar1b iar1l iar1h bcr1l bcr1h dstat dmode 2 a 2 b 2 c 2 e 2 f 3 0 3 1 table 57. internal i/o registers (continued) register mnemonics address remarks de1 de0 dwe0 die1 die0 ? dme r/w r/w r/w w w r dma enable bit write enable 1,0 dma enable ch 1,0 0 0 1 0 1 0 1 0 bit during reset r/w dma master enable dma interrupt enable 1,0 dm1,0 0 0 0 1 1 0 1 1 m m i/o m destination dwe1 address dar0+1 dar0-1 dar0 fixed dar0 fixed ? ? dm0 sm1 sm0 mmod ? r/w r/w r/w r/w ch 0 destination mode 1,0 0 1 0 1 0 0 0 1 bit during reset r/w memory mode select ch 0 source mode 1,0 dm1 r/w sm1,0 0 0 0 1 1 0 1 1 m m i/o m source address sar0+1 sar0-1 sar0 fixed sar0 fixed mmod mode 0 1 cycle steal mode burst mode r/w bits 0 - 2 are used for mar1b
z8018x family mpu user manual 300 um005001-zmp0400 mmu common base register: mmu bank base register mmu common/bank register operation mode control register i/o control register: cbr bbr cbar omcr icr 3 8 3 9 3 a 3 e 3 f table 57. internal i/o registers (continued) register mnemonics address remarks r/w r/w r/w 0 0 0 0 0 0 0 cb7 cb6 cb5 0 bit during reset r/w mmu common base register r/w r/w 1 1 1 1 0 0 0 0 bit during reset r/w mmu common area register r/w r/w mmu bank cb4 cb3 cb2 cb1 cb0 r/w r/w r/w r/w r/w r/w r/w r/w 0 0 0 0 0 0 0 bb7 bb6 bb5 0 bit during reset r/w mmu bank base register bb4 bb3 bb2 bb1 bb0 r/w r/w r/w r/w r/w ca3 ca2 ca1 ca0 ba3 ba2 ba1 ba0 r/w r/w r/w r/w r/w 1 1 1 1 1 1 1 1 bit during reset r/w m1 enable i/o compatibility mie mite ioc ? w r/w ? ? ? ? m1 temporary enable r/w 0 0 1 0 1 1 1 1 bit during reset r/w i/o address i/o stop ioa7 ? r/w ? ? ? ? ioa6 iostp r/w area register
z8018x family mpu user manual um005001-zmp0400 301 dma/wait control register: dcntl 3 2 table 57. internal i/o registers (continued) register mnemonics address remarks r/w r/w r/w r/w r/w r/w r/w r/w 1 1 1 1 0 0 0 mwi1 mwi0 iwi1 dms0 dima1 dima0 iwi0 0 bit during reset r/w dms1 the number of 0 0 mwi1,0 dma ch 1 i/o memory i/o wait insertion memory wait insertion 0 1 0 1 1 0 1 1 mode select wait states 2 3 the number of 0 0 iwi1,0 0 2 0 1 1 0 1 1 wait states 3 4 1 dmsi edge sense 0 sense level sense 0 0 dim1,0 m ? i/o 0 1 1 0 1 1 transfer mode m ? i/o i/o ? m i/o ? m m ar1+1 address increment/decrement m ar1-1 i ar1 fixed i ar1 fixed i ar1 fixed i ar1 fixed m ar1+1 m ar1-1 dreqi select, i=1,0
z8018x family mpu user manual 302 um005001-zmp0400 interrupt vector low register int/trap control register refresh control register: il itc rcr 33 3 4 3 6 table 57. internal i/o registers (continued) register mnemonics address remarks r/w r/w r/w 0 0 0 0 0 0 0 il7 il6 il5 ? ? ? ? 0 bit during reset r/w ? interrupt vector low r/w r r/w 0 0 1 1 0 0 0 trap uf0 ? ? 1 bit during reset r/w ? unidentified fetch object ite2 ite1 ite0 r/w r/w int enable 2,1,0 trap r/w r/w 1 1 1 1 1 0 0 refe refw ? ? 1 bit during reset r/w ? refresh wait state cyc1 cyc0 r/w r/w cycle select refresh enable ? 0 0 10 states 20 0 1 1 0 1 1 interval of refresh cycle 40 80
z8018x family mpu user manual um005001-zmp0400 303 ordering information codes ? package p = plastic dip v = plastic chip carrier f = quad flat pack ? temperature s = 0 c to +70 c e = -40 c to 100 c ? speed 06 = 6 mhz 08 = 8 mhz 10 = 10 mhz ? environmental c = plastic standard ? example z8018008psc is an 80180 8 mhz, plastic dip, 0 c to 70 c, plastic standard flow. z 80180 08 p s c environmental flow temperature package speed product number zilog prefix
z8018x family mpu user manual 304 um005001-zmp0400
z8018x family mpu user manual um005001-zmp0400 305 a ac characteristics 197 address generation, physical 64 address map i/o 44 i/o address translation 57 logical examples 55 logical memory organization 58 logical space configuration 59 physical address transition 56 addressing extended 182 i/o 184 indexed 182 indirect 181 architecture 12 asci baud rate selection 142 block diagram 117 clock diagram 141 control register a0 125 control register a1 128 control register b 131 functions 116 interrupt request circuit diagram 140 register descriptions 117 status register 0 120 status register 1 123 asynchronous serial communications interface (asci) 14 b baud rate selection asci 142 csi/o 150 block diagram 6 asci 117 csi/o 146 dmac 92 mmu 56 prt 157 bus state controller 13 c central processing unit (cpu) 14 circuit diagram, asci interrupt request 140 clock generator 13 clocked serial i/o (csi/o) 14 cpu register configurations 176 cpu timing basic instruction 23 busreq/busack bus exchange 25 halt and low power modes 31 i/o data read/write 22 internal i/o registers 41 mmu register description 60 op code fetch timing 18 operand and data read/write 20 reset 25 wait state generator 27
z8018x family mpu user manual um005001-zmp0400 306 csi/o baud rate selection 150 block diagram 146 control/status register 147, 150, 159, 160, 161, 172 external clock receivetiming diagram 156 external clock transmit timing diagram 154 internal clock receivetiming diagram 155 internal clock transmit timing diagram 153 interrupt request generation 151 operation 151 receive/transmit timing diagram 204 timer initialization, count down and reload timing diagram 163 timer output control 163 timer output timing diagram 164 cycle timing 87 d data formats 131 dc characteristics absolute maximum ratings 185 z80180 186 z8l180 189 z8s180 187 dcd0 timing diagram 139 description, general 1 design rules, circuit board 170 direct register bit field definitions 181 divide ratio 134 dma controller (dmac) 90 cycle steal mode timing diagram 106 edge-sense timing diagram 108 interrupt request generation 114 level-sense timing diagram 107 mode register (dmode) 97 operation 104 status register (dstat) 95 tend0 output timing diagram 108 transfer request 110 wait control register 100 dmac block diagram 92 register 93 dram refresh intervals 89 dynamic ram refresh control 86 e e clock bus release, sleep and system stop modes timing diagram 201 memory and i/o r/w cycles timing dia- gram 201 minimum timing example of pwel and pweh timing diagram 202 timing conditions 166 timing diagram (r/w and intack cy-
z8018x family mpu user manual um005001-zmp0400 307 cles) 167 timing diagram (sleep and system stop modes) 168 extended addressing 182 external clock rise and fall time 204 f features 1 h halt mode 31 i i/o addressing 184 control register (icr) 42 i/o control register 42 immediate addressing addressing immediate 183 indexed addressing 182 indirect addressing 181 input ris and fall time (except extal and re- set) timing diagram 204 instruction set cpu registers 175 flag register 178 summary 173 int0 interrupt mode 2 timing 80 mode 1 interrupt sequence 77 mode 1 timing 78 int0 mode 0 timing 76 interrupt acknowledge cycle timings 82 control registers and flags 65 controller 13 csi/o request generation 151 dma request generation 114 enable (ite) 68 int/trap control register (itc) 67 maskable interrupt 0 (int0) 75 non-maskable 72 prt request generation 164 sources 65 sources during reset 83 trap 70 vector register (i) 66 iostop mode 35 l level-sense programming 109 logical memory organization 58 m m1 temporary enable timing 16 maskable interrupt level 0 75
z8018x family mpu user manual um005001-zmp0400 308 memory and i/o wait state insertion 29 memory management unit (mmu) 13 memory to asci 109 memory to memory 105 mmu register description 60 mode halt 31 iostop 35 sleep 33 system stop 35 modem control signals 138 n nmi and dma operation timing diagram 115 use 74 non-maskable interrupt 72 o on-chip clock generator circuit board design rules 170 external clock interface 169 operating frequencies 168 operation modes control register 84 cpu timing 18 ioc 16 m1 enable 15 m1 temporary enable 16 p pin description a0 through cts1 7 busreq through rfsh 9 d0 through int2 8 rts0 through tend1 10 test through xtal 10 pin package 64-pin dip 3 68-pin plcc 4 80-pin qfp 5 programmable reload timer (prt) 14 programming level-sense 109 prt block diagram 157 bus release mode timing diagram 167 interrupt request generation 164 timer control register 161 r refresh 87 control register 88 register asci control a0 125 asci control a1 128 asci control b 131 asci status 0 120 asci status 1 123
z8018x family mpu user manual um005001-zmp0400 309 csi/o control/status 147, 150, 159, 160, 161, 172 direct bit field definitions 181 dma mode (dmode) 97 dma status 95 dma/wait control 100 flag 178 i/o control 42 i/o control (icr) 42 indirect addressing 181 int/trap control (itc) 67 interrupt vector (i) 66 mmu bank base (bbr) 62 mmu common bank area (cbar) 60 mmu common base (cbr) 61 operation mode control 15, 84 prt timer control register 161 refresh control 88 relative addressing addressing relative 183 reti control signal states 85 instruction sequence 84 rts0 timing diagram 140 s secondary bus interface 165 sleep mode 33 slp execution cycle timing diagram timing diagram slp execution cycle 203 status summary table 10 system stop mode 35 t test conditions, standard 205 timer initialization, count down and reload 163 timer output timing diagram timing diagram timer output 202 timing diagram 163 ac 197 bus exchange timing during cpu inter- nal operation 27 bus exchange timing during memory read 26 cpu (i/o read/write cycles) 199 csi/o external clock receive 156 csi/o external clock transmit 154 csi/o internal clock receive 155 csi/o internal clock transmit 153 csi/o receive/transmit 204 csi/o timer output 164 dcd0 139 dma control signals 200 dma cycle steal mode 106 dma edge-sense 108 dma level-sense 107
z8018x family mpu user manual um005001-zmp0400 310 dma tend0 output 108 e clock (memory and i/o r/w cycles) 201 e clock (r/w and intack cycles) 167 e clock (sleep and system stop modes) 168 e clock bus release, sleep and sys- tem stop modes) 201 e clock minimum timing example of pwel and pweh) 202 external clock rise and fall 204 halt 33 i/o read and write cycles with ioc = 0 17 i/o read and write cycles with ioc=1 17 i/o read/write timing 23 input rise and fall time 204 instruction 24 int0 interrupt mode 2 80 int0 mode 0 76 int0 mode 1 78 int1, int2 and internal interrupts 86 m1 temporary enable 16 memory read/write timing (with wait state) 22 memory read/write timing (without wait state) 21 nmi and dma operation 115 op code fetch timing (with wait state) 20 op code fetch timing (without wait state) 19 prt bus release mode 167 refresh cycle 87 reset 25 rts0 140 sleep 35 trap timing - 2nd op code undefined 71 trap timing - 3rd op code undefined 72 wait 28 trap 68 interrupt 70 timing 71 u undefined fetch object (ufo) 68 v vector acquisition int0 mode 2 79 int1, int2 81 vector table 82 w wait state generation i/o wait insertion 29 memory and 29 programmable wait state insertion 28 wait input and reset 30 wait state insertion 30


▲Up To Search▲   

 
Price & Availability of Z8L18008FEC

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X